Fix calling order of PyEval_InitThreads. (GH-4602)
As described in Doc/c-api/init.rst, PyEval_InitThreads() cannot be called before Py_Initialize() function.
This commit is contained in:
parent
e45b217ae0
commit
9e61066355
|
@ -422,8 +422,8 @@ CThunkObject *_ctypes_alloc_callback(PyObject *callable,
|
|||
static void LoadPython(void)
|
||||
{
|
||||
if (!Py_IsInitialized()) {
|
||||
PyEval_InitThreads();
|
||||
Py_Initialize();
|
||||
PyEval_InitThreads();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue