Skip to content

Commit 6bc889a

Browse files
gh-76785: Print the Traceback from Interpreter.run() (gh-110248)
This is a temporary fix. The full fix may involve serializing the traceback in some form.
1 parent 77e9aae commit 6bc889a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Modules/_xxsubinterpretersmodule.c

+4
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,10 @@ _run_script(PyInterpreterState *interp, const char *codestr,
450450
"RunFailedError: script raised an uncaught exception (%s)",
451451
failure);
452452
}
453+
// XXX Instead, store the rendered traceback on sharedexc,
454+
// attach it to the exception when applied,
455+
// and teach PyErr_Display() to print it.
456+
PyErr_Display(NULL, excval, NULL);
453457
Py_XDECREF(excval);
454458
if (errcode != ERR_ALREADY_RUNNING) {
455459
_PyInterpreterState_SetNotRunningMain(interp);

0 commit comments

Comments
 (0)