gh-76785: Print the Traceback from Interpreter.run() (gh-110322)

This is a temporary solution.  The full fix may involve serializing the traceback in some form.

(FYI, I merged this yesterday and the reverted it due to buildbot failures.  See gh-110248.)
This commit is contained in:
Eric Snow 2023-10-04 11:57:03 -06:00 committed by GitHub
parent 3bbe3b7c82
commit ee317f7ddd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -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);
}