From 6a222a377809e61e33c292b2015f3fbd83b6dce3 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Fri, 9 Oct 2009 14:48:25 -0300 Subject: [PATCH] fix globals cleanup code generation --HG-- extra : rebase_source : 892238115e1b0c2f36411ee14110c2207230ca02 --- Cython/Compiler/Code.py | 5 +++++ Cython/Compiler/ModuleNode.py | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) 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('.', '__')) -- 2.26.2