From 1e354c8d1f4cf0b85b45a0d208e291df1ad74af2 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 20 Mar 2018 19:00:23 -0400 Subject: [PATCH] Handle errors without tracebacks --- src/python2js.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/python2js.cpp b/src/python2js.cpp index 673bcf88e..3e9ec3f6d 100644 --- a/src/python2js.cpp +++ b/src/python2js.cpp @@ -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) {