Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ee317f7

Browse filesBrowse files
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.)
1 parent 3bbe3b7 commit ee317f7
Copy full SHA for ee317f7

File tree

1 file changed

+7
-1
lines changed
Filter options

1 file changed

+7
-1
lines changed

‎Modules/_xxsubinterpretersmodule.c

Copy file name to clipboardExpand all lines: Modules/_xxsubinterpretersmodule.c
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,13 @@ _run_script(PyInterpreterState *interp, const char *codestr,
450450
"RunFailedError: script raised an uncaught exception (%s)",
451451
failure);
452452
}
453-
Py_XDECREF(excval);
453+
if (excval != NULL) {
454+
// XXX Instead, store the rendered traceback on sharedexc,
455+
// attach it to the exception when applied,
456+
// and teach PyErr_Display() to print it.
457+
PyErr_Display(NULL, excval, NULL);
458+
Py_DECREF(excval);
459+
}
454460
if (errcode != ERR_ALREADY_RUNNING) {
455461
_PyInterpreterState_SetNotRunningMain(interp);
456462
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.