diff --git a/Modules/_xxsubinterpretersmodule.c b/Modules/_xxsubinterpretersmodule.c index e1c7d4ab2fd78f..528ed2760cf78d 100644 --- a/Modules/_xxsubinterpretersmodule.c +++ b/Modules/_xxsubinterpretersmodule.c @@ -410,6 +410,10 @@ _run_script(PyInterpreterState *interp, const char *codestr, failure); PyErr_Clear(); } + // 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); assert(!PyErr_Occurred()); _PyInterpreterState_SetNotRunningMain(interp);