Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 55a5c78

Browse files
author
Victor Stinner
committed
Py_FatalError(): don't sys sys.last_xxx variables
Call PyErr_PrintEx(0) instead of PyErr_Print() to avoid a crash if Py_FatalError() is called in an early stage of Python initialization (if PySys is not yet initialized).
1 parent 9b7e2d1 commit 55a5c78

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Python/pythonrun.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2055,7 +2055,7 @@ Py_FatalError(const char *msg)
20552055
fprintf(stderr, "Fatal Python error: %s\n", msg);
20562056
fflush(stderr); /* it helps in Windows debug build */
20572057
if (PyErr_Occurred()) {
2058-
PyErr_Print();
2058+
PyErr_PrintEx(0);
20592059
}
20602060
#ifdef MS_WINDOWS
20612061
{

0 commit comments

Comments
 (0)