Issue #8063: Call _PyGILState_Init() earlier in Py_InitializeEx().
authorVictor Stinner <victor.stinner@haypocalc.com>
Tue, 17 Aug 2010 22:26:51 +0000 (22:26 +0000)
committerVictor Stinner <victor.stinner@haypocalc.com>
Tue, 17 Aug 2010 22:26:51 +0000 (22:26 +0000)
Misc/NEWS
Python/pythonrun.c

index 4e11922867849c77a92a9db41c7295ff07d195da..586aa7e0e7e34783355670b6222022f1f6a57629 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,8 @@ What's New in Python 3.2 Alpha 2?
 Core and Builtins
 -----------------
 
+- Issue #8063: Call _PyGILState_Init() earlier in Py_InitializeEx().
+
 - Issue #9612: The set object is now 64-bit clean under Windows.
 
 - Issue #8202: sys.argv[0] is now set to '-m' instead of '-c' when searching
index a7a54ba71018155062d7e64db5a338bee90e2f9e..76a8eef2df4b3a35ce74e16c94a31dbe0dd3b242 100644 (file)
@@ -206,6 +206,11 @@ Py_InitializeEx(int install_sigs)
         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_InitializeEx(int install_sigs)
         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 */
 }