Skip to content

Commit 4fbe0ee

Browse files
miss-islingtonmrkn
authored andcommitted
Fix calling order of PyEval_InitThreads. (GH-5833)
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 <mrkn@users.noreply.github.com>
1 parent 0fccd4a commit 4fbe0ee

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
@@ -417,8 +417,8 @@ CThunkObject *_ctypes_alloc_callback(PyObject *callable,
417417
static void LoadPython(void)
418418
{
419419
if (!Py_IsInitialized()) {
420-
PyEval_InitThreads();
421420
Py_Initialize();
421+
PyEval_InitThreads();
422422
}
423423
}
424424

0 commit comments

Comments
 (0)