summaryrefslogtreecommitdiffstats
path: root/Modules/_ctypes
diff options
context:
space:
mode:
authorKenta Murata <mrkn@users.noreply.github.com>2019-09-10 10:29:56 (GMT)
committerBenjamin Peterson <benjamin@python.org>2019-09-10 10:29:56 (GMT)
commit9e61066355b4b55c873d56f5f106a22463b56862 (patch)
tree84631850736c2815505294080cf461a5d08194e6 /Modules/_ctypes
parente45b217ae0e83cfb367e9769cae59b9a5505f9b4 (diff)
downloadcpython-9e61066355b4b55c873d56f5f106a22463b56862.zip
cpython-9e61066355b4b55c873d56f5f106a22463b56862.tar.gz
cpython-9e61066355b4b55c873d56f5f106a22463b56862.tar.bz2
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 97463b5..d2d9a65 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();
}
}