From: Lisandro Dalcin Date: Fri, 9 Oct 2009 17:48:25 +0000 (-0300) Subject: fix globals cleanup code generation X-Git-Tag: 0.13.beta0~2^2~121^2~86^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6a222a377809e61e33c292b2015f3fbd83b6dce3;p=cython.git fix globals cleanup code generation --HG-- extra : rebase_source : 892238115e1b0c2f36411ee14110c2207230ca02 --- diff --git a/Cython/Compiler/Code.py b/Cython/Compiler/Code.py index 3a6dc39b..91438395 100644 --- a/Cython/Compiler/Code.py +++ b/Cython/Compiler/Code.py @@ -511,6 +511,11 @@ class GlobalState(object): w.putln("}") w.exit_cfunc_scope() + if Options.generate_cleanup_code: + w = self.parts['cleanup_globals'] + w.putln("}") + w.exit_cfunc_scope() + if Options.generate_cleanup_code: w = self.parts['cleanup_module'] w.putln("}") diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index 07eedde9..77c57b13 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -1779,7 +1779,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): # code.putln("Py_DECREF(%s); %s = 0;" % ( # code.entry_as_pyobject(entry), entry.cname)) code.putln("Py_INCREF(Py_None); return Py_None;") - code.putln('}') def generate_main_method(self, env, code): module_is_main = "%s%s" % (Naming.module_is_main, self.full_module_name.replace('.', '__'))