Handle errors without tracebacks

This commit is contained in:
Michael Droettboom 2018-03-20 19:00:23 -04:00
parent e0e1b12d9c
commit 1e354c8d1f
1 changed files with 2 additions and 2 deletions

View File

@ -11,7 +11,7 @@ val pythonExcToJs() {
PyObject *value;
PyObject *traceback;
bool no_traceback = false;
PyErr_Fetch(&type, &value, &traceback);
PyErr_NormalizeException(&type, &value, &traceback);
@ -19,7 +19,7 @@ val pythonExcToJs() {
PyObject *tbmod = PyImport_ImportModule("traceback");
if (tbmod == NULL) {
excval = val("Couldn't get traceback module");
excval = pythonToJs(PyObject_Repr(value));
} else {
PyObject *format_exception;
if (traceback == NULL || traceback == Py_None) {