Skip to content

Commit 9e61066

Browse files
mrknbenjaminp
authored andcommitted
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.
1 parent e45b217 commit 9e61066

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/_ctypes/callbacks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,8 @@ CThunkObject *_ctypes_alloc_callback(PyObject *callable,
422422
static void LoadPython(void)
423423
{
424424
if (!Py_IsInitialized()) {
425-
PyEval_InitThreads();
426425
Py_Initialize();
426+
PyEval_InitThreads();
427427
}
428428
}
429429

0 commit comments

Comments
 (0)