From: Stefan Behnel Date: Thu, 19 Mar 2009 10:35:54 +0000 (+0100) Subject: minor cleanup of thread-init code X-Git-Tag: 0.11.1.alpha~45 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0066fe4300e35e626a2df15906f7ebf6e7688556;p=cython.git minor cleanup of thread-init code --- 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 """)