]> granicus.if.org Git - python/commitdiff
Py_FatalError(): don't sys sys.last_xxx variables
authorVictor Stinner <victor.stinner@haypocalc.com>
Tue, 8 Jun 2010 21:00:13 +0000 (21:00 +0000)
committerVictor Stinner <victor.stinner@haypocalc.com>
Tue, 8 Jun 2010 21:00:13 +0000 (21:00 +0000)
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).

Python/pythonrun.c

index 1581c90fb318382dc5290a7c5512d55198a37d41..05a980085dd598ba26a147455e332d60c777b7c3 100644 (file)
@@ -2055,7 +2055,7 @@ Py_FatalError(const char *msg)
     fprintf(stderr, "Fatal Python error: %s\n", msg);
     fflush(stderr); /* it helps in Windows debug build */
     if (PyErr_Occurred()) {
-        PyErr_Print();
+        PyErr_PrintEx(0);
     }
 #ifdef MS_WINDOWS
     {