[Python-3000-checkins] r58966 - python/branches/py3k/Python/pythonrun.c

christian.heimes python-3000-checkins at python.org
Wed Nov 14 01:16:07 CET 2007


Author: christian.heimes
Date: Wed Nov 14 01:16:07 2007
New Revision: 58966

Modified:
   python/branches/py3k/Python/pythonrun.c
Log:
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.

Modified: python/branches/py3k/Python/pythonrun.c
==============================================================================
--- python/branches/py3k/Python/pythonrun.c	(original)
+++ python/branches/py3k/Python/pythonrun.c	Wed Nov 14 01:16:07 2007
@@ -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__");
 


More information about the Python-3000-checkins mailing list