Mercurial > cpython-lru_cache-weakref
diff Python/pythonrun.c @ 43848:e162e881ea5f
Moved the initalization of the exception before the initialization of sys.
On Windows _PySys_Init() could raise an uninitialized exception which leads to a seg fault.
| author | Christian Heimes <christian@cheimes.de> |
|---|---|
| date | Wed, 14 Nov 2007 00:16:07 +0000 |
| parents | 241281123fd8 |
| children | ee081609cee8 |
line wrap: on
line diff
--- a/Python/pythonrun.c Wed Nov 14 00:15:01 2007 +0000 +++ b/Python/pythonrun.c Wed Nov 14 00:16:07 2007 +0000 @@ -217,6 +217,9 @@ Py_FatalError("Py_Initialize: can't initialize builtins dict"); Py_INCREF(interp->builtins); + /* initialize builtin exceptions */ + _PyExc_Init(); + sysmod = _PySys_Init(); if (sysmod == NULL) Py_FatalError("Py_Initialize: can't initialize sys"); @@ -239,9 +242,6 @@ _PyImport_Init(); - /* initialize builtin exceptions */ - _PyExc_Init(); - /* phase 2 of builtins */ _PyImport_FixupExtension("__builtin__", "__builtin__");
