+ register python type if its dict doesn't exist
This commit is contained in:
parent
202b51171c
commit
1059ff14fc
|
@ -385,6 +385,12 @@ PyObject *FeaturePythonPyT<FeaturePyT>::getCustomAttributes(const char* attr) co
|
||||||
if (Base::streq(attr, "__dict__")){
|
if (Base::streq(attr, "__dict__")){
|
||||||
// Return the default dict
|
// Return the default dict
|
||||||
PyTypeObject *tp = this->ob_type;
|
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);
|
PyObject* dict = PyDict_Copy(tp->tp_dict);
|
||||||
std::map<std::string,App::Property*> Map;
|
std::map<std::string,App::Property*> Map;
|
||||||
FeaturePyT::getPropertyContainerPtr()->getPropertyMap(Map);
|
FeaturePyT::getPropertyContainerPtr()->getPropertyMap(Map);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user