From 1059ff14fcc0bc1222f8beef7959611e0aac9ca3 Mon Sep 17 00:00:00 2001 From: wmayer Date: Fri, 25 Sep 2015 00:51:38 +0200 Subject: [PATCH] + register python type if its dict doesn't exist --- src/App/FeaturePythonPyImp.inl | 6 ++++++ 1 file changed, 6 insertions(+) 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);