fix globals cleanup code generation
authorLisandro Dalcin <dalcinl@gmail.com>
Fri, 9 Oct 2009 17:48:25 +0000 (14:48 -0300)
committerLisandro Dalcin <dalcinl@gmail.com>
Fri, 9 Oct 2009 17:48:25 +0000 (14:48 -0300)
--HG--
extra : rebase_source : 892238115e1b0c2f36411ee14110c2207230ca02

Cython/Compiler/Code.py
Cython/Compiler/ModuleNode.py

index 3a6dc39b89d5b6a481c0bbea13b81c9355f41878..91438395e1885dc53e533f2440ae3871e1d790dc 100644 (file)
@@ -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("}")
index 07eedde9582c578c4b1098a6f1d8d72dfd1f6b34..77c57b13c1577a3c3e1530a1517d953291d67f0c 100644 (file)
@@ -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('.', '__'))