From: Dag Sverre Seljebotn Date: Wed, 30 Jul 2008 10:30:15 +0000 (+0200) Subject: Module init func must also declare codewrite temps X-Git-Tag: 0.9.8.1~49^2~45 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f614efffc3ce979391abb93b56d49b23c4822503;p=cython.git Module init func must also declare codewrite temps --- 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):