+ register python type if its dict doesn't exist

This commit is contained in:
wmayer 2015-09-25 00:51:38 +02:00
parent 202b51171c
commit 1059ff14fc

View File

@ -385,6 +385,12 @@ PyObject *FeaturePythonPyT<FeaturePyT>::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<std::string,App::Property*> Map;
FeaturePyT::getPropertyContainerPtr()->getPropertyMap(Map);