From 0066fe4300e35e626a2df15906f7ebf6e7688556 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Thu, 19 Mar 2009 11:35:54 +0100 Subject: [PATCH] minor cleanup of thread-init code --- Cython/Compiler/ModuleNode.py | 2 +- Cython/Compiler/Nodes.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index ddb9b6b3..937240d0 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -1606,7 +1606,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): code.putln("/*--- Threads initialization code ---*/") code.putln("#if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS") - code.putln("#ifdef WITH_THREAD") + code.putln("#ifdef WITH_THREAD /* Python build with threading support? */") code.putln("PyEval_InitThreads();") code.putln("#endif") code.putln("#endif") diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 9634b914..d9254ad0 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -5627,10 +5627,10 @@ static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) py23_init_threads_utility_code = UtilityCode( proto=""" #ifndef __PYX_FORCE_INIT_THREADS -#define __PYX_FORCE_INIT_THREADS 0 -#if PY_VERSION_HEX < 0x02040000 -#undef __PYX_FORCE_INIT_THREADS +#if PY_VERSION_HEX < 0x02040200 #define __PYX_FORCE_INIT_THREADS 1 +#else +#define __PYX_FORCE_INIT_THREADS 0 #endif #endif """) -- 2.26.2