summaryrefslogtreecommitdiff
path: root/Cython/Compiler/ModuleNode.py
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2020-05-04 04:35:36 +0200
committerStefan Behnel <stefan_ml@behnel.de>2021-07-01 09:36:48 +0200
commitdba5f6bb9922df044951f64bc889cd0592a3e483 (patch)
tree2ad1b4fd328df73ba1e5724f272f7f87674e142a /Cython/Compiler/ModuleNode.py
parent064463397f0ca5efe5e1c84108d9276ea217e242 (diff)
downloadcython-dba5f6bb9922df044951f64bc889cd0592a3e483.tar.gz
Stop calling PyEval_InitThreads() In Py3.7+ (where it has become a no-op).
Diffstat (limited to 'Cython/Compiler/ModuleNode.py')
-rw-r--r--Cython/Compiler/ModuleNode.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py
index fa896e619..f89af8ca5 100644
--- a/Cython/Compiler/ModuleNode.py
+++ b/Cython/Compiler/ModuleNode.py
@@ -2406,11 +2406,10 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code.put_error_if_neg(self.pos, "_import_array()")
code.putln("/*--- Threads initialization code ---*/")
- code.putln("#if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS")
- code.putln("#ifdef WITH_THREAD /* Python build with threading support? */")
+ code.putln("#if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 "
+ "&& defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS")
code.putln("PyEval_InitThreads();")
code.putln("#endif")
- code.putln("#endif")
code.putln("/*--- Module creation code ---*/")
self.generate_module_creation_code(env, code)