From: Stefan Behnel Date: Thu, 15 May 2008 08:29:38 +0000 (+0200) Subject: empty tuple is used by traceback builder => must be created early X-Git-Tag: 0.9.8rc1~37^2~62 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b7c34417da613a27679a2a26d5ef1a753c390d79;p=cython.git empty tuple is used by traceback builder => must be created early --- diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index db0122d3..69eb6807 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -1414,6 +1414,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): code.putln("%s; /*proto*/" % header) code.putln("%s {" % header) code.put_var_declarations(env.temp_entries) + 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 ---*/") env.generate_library_function_declarations(code) @@ -1432,7 +1433,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): code.putln("/*--- Builtin init code ---*/") self.generate_builtin_init_code(env, code) - code.putln("%s = PyTuple_New(0); %s" % (Naming.empty_tuple, code.error_goto_if_null(Naming.empty_tuple, self.pos))); code.putln("%s = 0;" % Naming.skip_dispatch_cname); code.putln("/*--- Global init code ---*/")