diff options
Diffstat (limited to 'py/modules/IcePy/Util.cpp')
-rw-r--r-- | py/modules/IcePy/Util.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/py/modules/IcePy/Util.cpp b/py/modules/IcePy/Util.cpp index 44dced4e48d..fa313ffe5cf 100644 --- a/py/modules/IcePy/Util.cpp +++ b/py/modules/IcePy/Util.cpp @@ -276,8 +276,14 @@ IcePy::PyException::getTypeName() #else PyObject* cls = (PyObject*)ex.get()->ob_type; #endif - PyObjectHandle str = PyObject_Str(cls); - return PyString_AsString(str.get()); + PyObjectHandle name = PyObject_GetAttrString(cls, "__name__"); + assert(name.get()); + PyObjectHandle mod = PyObject_GetAttrString(cls, "__module__"); + assert(mod.get()); + string result = PyString_AsString(mod.get()); + result += "."; + result += PyString_AsString(name.get()); + return result; } IcePy::AllowThreads::AllowThreads() |