From: Christian Heimes Date: Wed, 14 Nov 2007 00:16:07 +0000 (+0000) Subject: Moved the initalization of the exception before the initialization of sys. X-Git-Tag: v3.0a2~190 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9a68f8c3041fbd91f1e1a116d6c773fab3645cf6;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 044c4a90d9b2..763f9059bb52 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -217,6 +217,9 @@ Py_InitializeEx(int install_sigs) 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 @@ Py_InitializeEx(int install_sigs) _PyImport_Init(); - /* initialize builtin exceptions */ - _PyExc_Init(); - /* phase 2 of builtins */ _PyImport_FixupExtension("__builtin__", "__builtin__");