From: Vitja Makarov <vitja.makarov@gmail.com>
Date: Sun, 9 Jan 2011 16:30:17 +0000 (+0300)
Subject: Fix naming problem
X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bf5eec6dff59b7e013f0f7dd06bd9325c39285ee;p=cython.git

Fix naming problem
---

diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py
index 01ce116d..b23b81fb 100644
--- a/Cython/Compiler/Nodes.py
+++ b/Cython/Compiler/Nodes.py
@@ -2951,9 +2951,9 @@ class GeneratorBodyDefNode(DefNode):
 
     def declare_generator_body(self, env):
         prefix = env.next_id(env.scope_prefix)
-        entry = env.declare_var(prefix + 'generator', py_object_type, self.pos, visibility='private')
-        entry.func_cname = \
-            Naming.genbody_prefix + prefix + self.name
+        name = env.next_id('generator')
+        entry = env.declare_var(prefix + name, py_object_type, self.pos, visibility='private')
+        entry.func_cname = Naming.genbody_prefix + prefix + name
         entry.qualified_name = EncodedString(self.name)
         self.entry = entry
 
diff --git a/Cython/Compiler/ParseTreeTransforms.py b/Cython/Compiler/ParseTreeTransforms.py
index af79e7e4..01be309d 100644
--- a/Cython/Compiler/ParseTreeTransforms.py
+++ b/Cython/Compiler/ParseTreeTransforms.py
@@ -208,7 +208,7 @@ class PostParse(ScopeTrackingTransform):
         self.genexpr_counter += 1
         node.genexpr_name = EncodedString(u'genexpr%d' % genexpr_id)
 
-        node.def_node = Nodes.DefNode(node.pos, name=node.genexpr_name,
+        node.def_node = Nodes.DefNode(node.pos, name=node.name,
                                       doc=None,
                                       args=[], star_arg=None,
                                       starstar_arg=None,