X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.pythonlink.win32.x86_64%2Fsrc%2Fsclpy.c;fp=org.simantics.pythonlink.win32.x86_64%2Fsrc%2Fsclpy.c;h=8e41834ee1d2c505bc0a8e4764782e4c08323503;hb=025afe064401dba02dd70cf3daa1b94d52966aa8;hp=8de3c87ea29517cd42438f8a04fdca3575d4fc8a;hpb=ed5759e22d06d82af4bc67e27239aa4e66310b8b;p=simantics%2Fpython.git diff --git a/org.simantics.pythonlink.win32.x86_64/src/sclpy.c b/org.simantics.pythonlink.win32.x86_64/src/sclpy.c index 8de3c87..8e41834 100644 --- a/org.simantics.pythonlink.win32.x86_64/src/sclpy.c +++ b/org.simantics.pythonlink.win32.x86_64/src/sclpy.c @@ -886,7 +886,11 @@ Java_org_simantics_pythonlink_PythonContext_executePythonStatementImpl( Py_DECREF(message); } else { - throwPythonException(env, "Internal error, no message"); + PyTypeObject + *ty = (PyTypeObject *)exceptionType; + throwPythonException( + env, ty ? ty->tp_name + : "Internal error, null exception type"); } Py_DECREF(args); Py_DECREF(formatExc); @@ -900,6 +904,9 @@ Java_org_simantics_pythonlink_PythonContext_executePythonStatementImpl( throwPythonException(env, "Internal error, no traceback module"); } } + Py_XDECREF(exceptionType); + Py_XDECREF(exception); + Py_XDECREF(traceback); } PyEval_SaveThread();