From ba4021679101216915be4b6dea7e860128205b8e Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 27 Sep 2018 21:47:03 +0200 Subject: [PATCH] fixes 0003311: SketchObjectPython - no addGeometry addConstraints setDriving...? --- src/Base/PyObjectBase.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Base/PyObjectBase.cpp b/src/Base/PyObjectBase.cpp index 2c2dc9e974..5b724dc6a8 100644 --- a/src/Base/PyObjectBase.cpp +++ b/src/Base/PyObjectBase.cpp @@ -148,6 +148,15 @@ PyObject* PyObjectBase::__getattro(PyObject * obj, PyObject *attro) attr = PyString_AsString(attro); #endif + // For the __class__ attribute get it directly as with + // ExtensionContainerPy::getCustomAttributes we may get + // the wrong type object (#0003311) + if (streq(attr, "__class__")) { + PyObject* res = PyObject_GenericGetAttr(obj, attro); + if (res) + return res; + } + // This should be the entry in Type PyObjectBase* pyObj = static_cast(obj); if (!pyObj->isValid()){