From: Timo Korvola Date: Mon, 30 Jan 2017 15:58:18 +0000 (+0200) Subject: Print exception type name if we can't get a traceback. X-Git-Tag: v1.31.0~6^2 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=025afe064401dba02dd70cf3daa1b94d52966aa8;p=simantics%2Fpython.git Print exception type name if we can't get a traceback. Also decref PyErr_Fetch results. Change-Id: I3e497d6750b08e24a9631c83a2b6e0e3c1502d79 --- diff --git a/org.simantics.pythonlink.win32.x86_64/jnipython.dll b/org.simantics.pythonlink.win32.x86_64/jnipython.dll index 261bac3..dbf7cb4 100644 Binary files a/org.simantics.pythonlink.win32.x86_64/jnipython.dll and b/org.simantics.pythonlink.win32.x86_64/jnipython.dll differ 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();