diff --git a/src/App/FeaturePythonPyImp.inl b/src/App/FeaturePythonPyImp.inl index a9f7225e0..6c4f0fb2a 100644 --- a/src/App/FeaturePythonPyImp.inl +++ b/src/App/FeaturePythonPyImp.inl @@ -385,6 +385,12 @@ PyObject *FeaturePythonPyT::getCustomAttributes(const char* attr) co if (Base::streq(attr, "__dict__")){ // Return the default dict PyTypeObject *tp = this->ob_type; + // register type if needed + if (tp->tp_dict == NULL) { + if (PyType_Ready(tp) < 0) + return 0; + } + PyObject* dict = PyDict_Copy(tp->tp_dict); std::map Map; FeaturePyT::getPropertyContainerPtr()->getPropertyMap(Map);