Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6961bd6

Browse files
author
Victor Stinner
committed
Issue #8063: Call _PyGILState_Init() earlier in Py_InitializeEx().
1 parent 6009ece commit 6961bd6

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ What's New in Python 3.2 Alpha 2?
1212
Core and Builtins
1313
-----------------
1414

15+
- Issue #8063: Call _PyGILState_Init() earlier in Py_InitializeEx().
16+
1517
- Issue #9612: The set object is now 64-bit clean under Windows.
1618

1719
- Issue #8202: sys.argv[0] is now set to '-m' instead of '-c' when searching

Python/pythonrun.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,11 @@ Py_InitializeEx(int install_sigs)
206206
Py_FatalError("Py_Initialize: can't make first thread");
207207
(void) PyThreadState_Swap(tstate);
208208

209+
/* auto-thread-state API, if available */
210+
#ifdef WITH_THREAD
211+
_PyGILState_Init(interp, tstate);
212+
#endif /* WITH_THREAD */
213+
209214
_Py_ReadyTypes();
210215

211216
if (!_PyFrame_Init())
@@ -288,11 +293,6 @@ Py_InitializeEx(int install_sigs)
288293
Py_FatalError(
289294
"Py_Initialize: can't initialize sys standard streams");
290295

291-
/* auto-thread-state API, if available */
292-
#ifdef WITH_THREAD
293-
_PyGILState_Init(interp, tstate);
294-
#endif /* WITH_THREAD */
295-
296296
if (!Py_NoSiteFlag)
297297
initsite(); /* Module site */
298298
}

0 commit comments

Comments
 (0)