include PyObjectPlus method in __dict__
authorCampbell Barton <ideasman42@gmail.com>
Sat, 4 Apr 2009 09:54:05 +0000 (09:54 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 4 Apr 2009 09:54:05 +0000 (09:54 +0000)
source/gameengine/Expressions/PyObjectPlus.cpp

index ac1871300d0ecabdf0238e8990f5372006fca262..03afa62a6dac2d8de2e6a38b20630f81d85c7708 100644 (file)
@@ -110,6 +110,9 @@ PyObject *PyObjectPlus::py_getattro(PyObject* attr)
 {
        PyObject *descr = PyDict_GetItem(Type.tp_dict, attr); \
        if (descr == NULL) {
+               if (strcmp(PyString_AsString(attr), "__dict__")==0) {
+                       return py_getattr_dict(NULL, Methods, NULL); /* no Attributes yet */
+               }
                PyErr_SetString(PyExc_AttributeError, "attribute not found");
                return NULL;
        } else {