diff Python/pythonrun.c @ 64133:686b18bffb86

Issue #8063: Call _PyGILState_Init() earlier in Py_InitializeEx().
author Victor Stinner <victor.stinner@haypocalc.com>
date Tue, 17 Aug 2010 22:26:51 +0000
parents 1bd3534136a0
children 687cc854cb4b
line wrap: on
line diff
--- a/Python/pythonrun.c	Tue Aug 17 22:01:02 2010 +0000
+++ b/Python/pythonrun.c	Tue Aug 17 22:26:51 2010 +0000
@@ -206,6 +206,11 @@
         Py_FatalError("Py_Initialize: can't make first thread");
     (void) PyThreadState_Swap(tstate);
 
+    /* auto-thread-state API, if available */
+#ifdef WITH_THREAD
+    _PyGILState_Init(interp, tstate);
+#endif /* WITH_THREAD */
+
     _Py_ReadyTypes();
 
     if (!_PyFrame_Init())
@@ -288,11 +293,6 @@
         Py_FatalError(
             "Py_Initialize: can't initialize sys standard streams");
 
-    /* auto-thread-state API, if available */
-#ifdef WITH_THREAD
-    _PyGILState_Init(interp, tstate);
-#endif /* WITH_THREAD */
-
     if (!Py_NoSiteFlag)
         initsite(); /* Module site */
 }