summaryrefslogtreecommitdiff
path: root/Lib/python/pythreads.swg
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/python/pythreads.swg')
-rw-r--r--Lib/python/pythreads.swg8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/python/pythreads.swg b/Lib/python/pythreads.swg
index d8797e659..8d6c5ab49 100644
--- a/Lib/python/pythreads.swg
+++ b/Lib/python/pythreads.swg
@@ -8,8 +8,12 @@
# define SWIG_PYTHON_USE_GIL
# endif
# if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
-# ifndef SWIG_PYTHON_INITIALIZE_THREADS
-# define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads()
+# if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
+# if PY_VERSION_HEX < 0x03070000
+# define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads()
+# else
+# define SWIG_PYTHON_INITIALIZE_THREADS
+# endif
# endif
# ifdef __cplusplus /* C++ code */
class SWIG_Python_Thread_Block {