Fix calling order of PyEval_InitThreads. (GH-15836)

As described in Doc/c-api/init.rst, PyEval_InitThreads() cannot be called
before Py_Initialize() function.
(cherry picked from commit 9e61066355)

Co-authored-by: Kenta Murata <mrkn@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2019-09-10 07:37:56 -07:00 committed by Benjamin Peterson
parent ed99bb9ca6
commit 21dacea6ad
1 changed files with 1 additions and 1 deletions

View File

@ -422,8 +422,8 @@ CThunkObject *_ctypes_alloc_callback(PyObject *callable,
static void LoadPython(void)
{
if (!Py_IsInitialized()) {
PyEval_InitThreads();
Py_Initialize();
PyEval_InitThreads();
}
}