+ improve exception handling in initialization scripts

This commit is contained in:
wmayer
2015-12-29 23:42:29 +01:00
parent 9f4dc4616c
commit e9e9a38865
3 changed files with 18 additions and 5 deletions

View File

@@ -159,7 +159,10 @@ std::string InterpreterSingleton::runString(const char *sCmd)
presult = PyRun_String(sCmd, Py_file_input, dict, dict); /* eval direct */
if (!presult) {
throw PyException();
if (PyErr_ExceptionMatches(PyExc_SystemExit))
throw SystemExitException();
else
throw PyException();
}
PyObject* repr = PyObject_Repr(presult);