Index: Python/pythonrun.c =================================================================== --- Python/pythonrun.c (révision 78665) +++ Python/pythonrun.c (copie de travail) @@ -174,6 +174,12 @@ tstate = PyThreadState_New(interp); if (tstate == NULL) Py_FatalError("Py_Initialize: can't make first thread"); + + /* auto-thread-state API, if available */ +#ifdef WITH_THREAD + _PyGILState_Init(interp, tstate); +#endif /* WITH_THREAD */ + (void) PyThreadState_Swap(tstate); _Py_ReadyTypes(); @@ -251,11 +257,6 @@ if (!Py_NoSiteFlag) initsite(); /* Module site */ - /* auto-thread-state API, if available */ -#ifdef WITH_THREAD - _PyGILState_Init(interp, tstate); -#endif /* WITH_THREAD */ - if ((p = Py_GETENV("PYTHONIOENCODING")) && *p != '\0') { p = icodeset = codeset = strdup(p); free_codeset = 1;