diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2023-10-03 20:41:02 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-03 20:41:02 (GMT) |
commit | 6bc889aedc11cc8e0b9f57948a3d528ad2685497 (patch) | |
tree | 70657a3c6a0be15b9cf3a853b2cc24b8786a3c0b | |
parent | 77e9aae3837d9f0cf87461d023896f2c4aeb282f (diff) | |
download | cpython-6bc889aedc11cc8e0b9f57948a3d528ad2685497.zip cpython-6bc889aedc11cc8e0b9f57948a3d528ad2685497.tar.gz cpython-6bc889aedc11cc8e0b9f57948a3d528ad2685497.tar.bz2 |
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.
-rw-r--r-- | Modules/_xxsubinterpretersmodule.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/_xxsubinterpretersmodule.c b/Modules/_xxsubinterpretersmodule.c index 700282e..33feae8 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); |