From 97fb24d7c4f9b61ebbe026833fd7ed5034732803 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Thu, 19 Mar 2009 16:45:48 +0100 Subject: [PATCH] minor cleanups --- Cython/Compiler/Nodes.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index d9254ad0..f69cd3a2 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -1075,7 +1075,7 @@ class FuncDefNode(StatNode, BlockNode): # ----- GIL acquisition acquire_gil = self.need_gil_acquisition(lenv) if acquire_gil: - env.use_utility_code(py23_init_threads_utility_code) + env.use_utility_code(force_init_threads_utility_code) code.putln("PyGILState_STATE _save = PyGILState_Ensure();") # ----- Automatic lead-ins for certain special functions if not lenv.nogil: @@ -4529,7 +4529,7 @@ class GILStatNode(TryFinallyStatNode): finally_clause = GILExitNode(pos, state = state)) def analyse_expressions(self, env): - env.use_utility_code(py23_init_threads_utility_code) + env.use_utility_code(force_init_threads_utility_code) was_nogil = env.nogil env.nogil = 1 TryFinallyStatNode.analyse_expressions(self, env) @@ -4539,11 +4539,11 @@ class GILStatNode(TryFinallyStatNode): pass def generate_execution_code(self, code): - code.putln("/*with %s:*/ {" % self.state) + code.mark_pos(self.pos) if self.state == 'gil': - code.putln("PyGILState_STATE _save = PyGILState_Ensure();") + code.putln("{ PyGILState_STATE _save = PyGILState_Ensure();") else: - code.putln("PyThreadState *_save;") + code.putln("{ PyThreadState *_save;") code.putln("Py_UNBLOCK_THREADS") TryFinallyStatNode.generate_execution_code(self, code) code.putln("}") @@ -5624,7 +5624,7 @@ static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) #------------------------------------------------------------------------------------ -py23_init_threads_utility_code = UtilityCode( +force_init_threads_utility_code = UtilityCode( proto=""" #ifndef __PYX_FORCE_INIT_THREADS #if PY_VERSION_HEX < 0x02040200 -- 2.26.2