Fix naming problem
authorVitja Makarov <vitja.makarov@gmail.com>
Sun, 9 Jan 2011 16:30:17 +0000 (19:30 +0300)
committerVitja Makarov <vitja.makarov@gmail.com>
Sun, 9 Jan 2011 16:30:17 +0000 (19:30 +0300)
Cython/Compiler/Nodes.py
Cython/Compiler/ParseTreeTransforms.py

index 01ce116dc8c0b791a790368bb62c6b679698f3c7..b23b81fbf0680ad1544a841b02519c9167c96321 100644 (file)
@@ -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
 
index af79e7e4a5dac84ae3ca59eec0a878352fef1c65..01be309d5283ece533b53e96e9e0dc551036377e 100644 (file)
@@ -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,