From: Stefan Behnel Date: Tue, 7 Apr 2009 13:56:49 +0000 (+0200) Subject: fix temp allocation when importing external C functions X-Git-Tag: 0.12.alpha0~331 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=141b62e6594ab1c7ff6605532d664b1933af656c;p=cython.git fix temp allocation when importing external C functions --- diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index 4234fa39..ec6fa733 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -37,7 +37,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): # body StatListNode # # referenced_modules [ModuleScope] - # module_temp_cname string # full_module_name string # # scope The module scope. @@ -63,9 +62,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): env.return_type = PyrexTypes.c_void_type self.referenced_modules = [] self.find_referenced_modules(env, self.referenced_modules, {}) - if self.has_imported_c_functions(): - self.module_temp_cname = env.allocate_temp_pyobject() - env.release_temp(self.module_temp_cname) if options.recursive: self.generate_dep_file(env, result) self.generate_c_code(env, options, result) @@ -1831,7 +1827,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): if entries: env.use_utility_code(import_module_utility_code) env.use_utility_code(function_import_utility_code) - temp = self.module_temp_cname + temp = code.globalstate.allocate_temp(py_object_type) code.putln( '%s = __Pyx_ImportModule("%s"); if (!%s) %s' % ( temp,