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:
parent
ed99bb9ca6
commit
21dacea6ad
|
@ -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