From 4a9da86b30c85ec47618990a45ca9c569b7c49a3 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Wed, 10 Feb 2010 15:32:17 -0800 Subject: [PATCH] Get rid of __Pyx_Name unused warning. --- Cython/Compiler/Code.py | 2 ++ Cython/Compiler/ExprNodes.py | 3 ++- Cython/Compiler/Nodes.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Cython/Compiler/Code.py b/Cython/Compiler/Code.py index d84c4223..1e46d2c7 100644 --- a/Cython/Compiler/Code.py +++ b/Cython/Compiler/Code.py @@ -637,6 +637,8 @@ class GlobalState(object): def put_cached_builtin_init(self, pos, name, cname): w = self.parts['cached_builtins'] interned_cname = self.get_interned_identifier(name).cname + from ExprNodes import get_name_interned_utility_code + self.use_utility_code(get_name_interned_utility_code) w.putln('%s = __Pyx_GetName(%s, %s); if (!%s) %s' % ( cname, Naming.builtins_cname, diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index b7023ab8..378d2dc3 100755 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -1248,8 +1248,8 @@ class NameNode(AtomicExprNode): self.is_temp = 0 else: self.is_temp = 1 + env.use_utility_code(get_name_interned_utility_code) self.is_used_as_rvalue = 1 - env.use_utility_code(get_name_interned_utility_code) def nogil_check(self, env): if self.is_used_as_rvalue: @@ -1336,6 +1336,7 @@ class NameNode(AtomicExprNode): namespace = Naming.builtins_cname else: # entry.is_pyglobal namespace = entry.scope.namespace_cname + code.globalstate.use_utility_code(get_name_interned_utility_code) code.putln( '%s = __Pyx_GetName(%s, %s); %s' % ( self.result(), diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 9474ee66..8e271c28 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -4166,7 +4166,7 @@ class ForFromStatNode(LoopNode, StatNode): target_node = ExprNodes.PyTempNode(self.target.pos, None) target_node.allocate(code) interned_cname = code.intern_identifier(self.target.entry.name) - code.putln("/*here*/") + code.globalstate.use_utility_code(ExprNodes.get_name_interned_utility_code) code.putln("%s = __Pyx_GetName(%s, %s); %s" % ( target_node.result(), Naming.module_cname, -- 2.26.2