From f614efffc3ce979391abb93b56d49b23c4822503 Mon Sep 17 00:00:00 2001 From: Dag Sverre Seljebotn Date: Wed, 30 Jul 2008 12:30:15 +0200 Subject: [PATCH] Module init func must also declare codewrite temps --- Cython/Compiler/ModuleNode.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index f2662a7e..26b778e3 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -1547,8 +1547,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): code.putln(header3) code.putln("#endif") code.putln("{") - - code.put_var_declarations(env.temp_entries) + tempdecl_code = code.insertion_point() code.putln("%s = PyTuple_New(0); %s" % (Naming.empty_tuple, code.error_goto_if_null(Naming.empty_tuple, self.pos))); code.putln("/*--- Libary function declarations ---*/") @@ -1609,6 +1608,10 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): code.putln("return NULL;") code.putln("#endif") code.putln('}') + + tempdecl_code.put_var_declarations(env.temp_entries) + tempdecl_code.put_temp_declarations(code.func) + code.exit_cfunc_scope() def generate_module_cleanup_func(self, env, code): -- 2.26.2