From 198ad760257a3ef6b9733e1be8d94ee21e8bec54 Mon Sep 17 00:00:00 2001 From: Eric Snow Date: Mon, 18 Sep 2023 11:22:02 -0600 Subject: [PATCH] Print the traceback. --- Modules/_xxsubinterpretersmodule.c | 4 ++++ 1 file changed, 4 insertions(+) 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);