Skip to content

Commit 21dacea

Browse files
miss-islingtonmrkn
authored andcommitted
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 9e61066) Co-authored-by: Kenta Murata <[email protected]>
1 parent ed99bb9 commit 21dacea

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)