Commit f614efff authored by Dag Sverre Seljebotn's avatar Dag Sverre Seljebotn

Module init func must also declare codewrite temps

parent e5928882
......@@ -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):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment