summaryrefslogtreecommitdiff
path: root/Modules/_ctypes
diff options
context:
space:
mode:
authorKenta Murata <mrkn@users.noreply.github.com>2019-09-10 19:29:56 +0900
committerBenjamin Peterson <benjamin@python.org>2019-09-10 11:29:56 +0100
commit9e61066355b4b55c873d56f5f106a22463b56862 (patch)
tree84631850736c2815505294080cf461a5d08194e6 /Modules/_ctypes
parente45b217ae0e83cfb367e9769cae59b9a5505f9b4 (diff)
downloadcpython-git-9e61066355b4b55c873d56f5f106a22463b56862.tar.gz
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.
Diffstat (limited to 'Modules/_ctypes')
-rw-r--r--Modules/_ctypes/callbacks.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_ctypes/callbacks.c b/Modules/_ctypes/callbacks.c
index 97463b599b..d2d9a6587d 100644
--- a/Modules/_ctypes/callbacks.c
+++ b/Modules/_ctypes/callbacks.c
@@ -422,8 +422,8 @@ CThunkObject *_ctypes_alloc_callback(PyObject *callable,
static void LoadPython(void)
{
if (!Py_IsInitialized()) {
- PyEval_InitThreads();
Py_Initialize();
+ PyEval_InitThreads();
}
}