Rename create_abstract_generator to create_generator_class, don't set entry cname
authorVitja Makarov <vitja.makarov@gmail.com>
Mon, 13 Dec 2010 07:07:18 +0000 (10:07 +0300)
committerVitja Makarov <vitja.makarov@gmail.com>
Mon, 13 Dec 2010 07:07:18 +0000 (10:07 +0300)
Cython/Compiler/ParseTreeTransforms.py

index ee44bf38fd90b5b92421d1578056fdc3b20acf1c..60cee2b0bec1130fdbae19fd5eda3428934bdad4 100644 (file)
@@ -1387,7 +1387,7 @@ class CreateClosureClasses(CythonTransform):
         self.visitchildren(node)
         return node
 
-    def create_abstract_generator(self, target_module_scope, pos):
+    def create_generator_class(self, target_module_scope, pos):
         if self.generator_class:
             return self.generator_class
         # XXX: make generator class creation cleaner
@@ -1395,7 +1395,6 @@ class CreateClosureClasses(CythonTransform):
                     objstruct_cname='__pyx_Generator_object',
                     typeobj_cname='__pyx_Generator_type',
                     pos=pos, defining=True, implementing=True)
-        entry.cname = 'Generator'
         klass = entry.type.scope
         klass.is_internal = True
         klass.directives = {'final': True}
@@ -1470,7 +1469,7 @@ class CreateClosureClasses(CythonTransform):
             node.needs_outer_scope = False
 
         if node.is_generator:
-            generator_class = self.create_abstract_generator(target_module_scope, node.pos)
+            generator_class = self.create_generator_class(target_module_scope, node.pos)
         elif not in_closure and not from_closure:
             return
         elif not in_closure: