Skip to content

Commit

Permalink
pythongh-76785: Print the Traceback from Interpreter.run() (pythongh-…
Browse files Browse the repository at this point in the history
…110248)

This is a temporary fix. The full fix may involve serializing the traceback in some form.
  • Loading branch information
ericsnowcurrently authored and Glyphack committed Jan 27, 2024
1 parent 6658c76 commit 4bf721b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Modules/_xxsubinterpretersmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,10 @@ _run_script(PyInterpreterState *interp, const char *codestr,
"RunFailedError: script raised an uncaught exception (%s)",
failure);
}
// XXX Instead, store the rendered traceback on sharedexc,
// attach it to the exception when applied,
// and teach PyErr_Display() to print it.
PyErr_Display(NULL, excval, NULL);
Py_XDECREF(excval);
if (errcode != ERR_ALREADY_RUNNING) {
_PyInterpreterState_SetNotRunningMain(interp);
Expand Down

0 comments on commit 4bf721b

Please sign in to comment.