From: Eric Snow Date: Tue, 3 Oct 2023 20:41:02 +0000 (-0600) Subject: gh-76785: Print the Traceback from Interpreter.run() (gh-110248) X-Git-Tag: v3.13.0a1~159 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6bc889aedc11cc8e0b9f57948a3d528ad2685497;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Modules/_xxsubinterpretersmodule.c b/Modules/_xxsubinterpretersmodule.c index 700282efb8c6..33feae8ee82f 100644 --- a/Modules/_xxsubinterpretersmodule.c +++ b/Modules/_xxsubinterpretersmodule.c @@ -450,6 +450,10 @@ error: "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);