summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/_xxsubinterpretersmodule.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/Modules/_xxsubinterpretersmodule.c b/Modules/_xxsubinterpretersmodule.c
index 700282e..bca16ac 100644
--- a/Modules/_xxsubinterpretersmodule.c
+++ b/Modules/_xxsubinterpretersmodule.c
@@ -450,7 +450,13 @@ error:
"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);
}