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
…110322)

This is a temporary solution.  The full fix may involve serializing the traceback in some form.

(FYI, I merged this yesterday and the reverted it due to buildbot failures.  See pythongh-110248.)
  • Loading branch information
ericsnowcurrently authored and Glyphack committed Jan 27, 2024
1 parent 87f3375 commit 27faa5a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Modules/_xxsubinterpretersmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,13 @@ _run_script(PyInterpreterState *interp, const char *codestr,
"RunFailedError: script raised an uncaught exception (%s)",
failure);
}
Py_XDECREF(excval);
if (excval != NULL) {
// 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_DECREF(excval);
}
if (errcode != ERR_ALREADY_RUNNING) {
_PyInterpreterState_SetNotRunningMain(interp);
}
Expand Down

0 comments on commit 27faa5a

Please sign in to comment.