comparison Python/pythonrun.c @ 62192:a25ad9c4ace0

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).
author Victor Stinner <victor.stinner@haypocalc.com>
date Tue, 08 Jun 2010 21:00:13 +0000
parents 815ba3872f85
children 72f774903772
comparison
equal deleted inserted replaced
62191:d92708cf1c1f 62192:a25ad9c4ace0
2053 Py_FatalError(const char *msg) 2053 Py_FatalError(const char *msg)
2054 { 2054 {
2055 fprintf(stderr, "Fatal Python error: %s\n", msg); 2055 fprintf(stderr, "Fatal Python error: %s\n", msg);
2056 fflush(stderr); /* it helps in Windows debug build */ 2056 fflush(stderr); /* it helps in Windows debug build */
2057 if (PyErr_Occurred()) { 2057 if (PyErr_Occurred()) {
2058 PyErr_Print(); 2058 PyErr_PrintEx(0);
2059 } 2059 }
2060 #ifdef MS_WINDOWS 2060 #ifdef MS_WINDOWS
2061 { 2061 {
2062 size_t len = strlen(msg); 2062 size_t len = strlen(msg);
2063 WCHAR* buffer; 2063 WCHAR* buffer;