Code cleanup
authorVitja Makarov <vitja.makarov@gmail.com>
Sat, 29 Jan 2011 11:38:33 +0000 (14:38 +0300)
committerVitja Makarov <vitja.makarov@gmail.com>
Sat, 29 Jan 2011 11:38:33 +0000 (14:38 +0300)
Cython/Compiler/ParseTreeTransforms.py

index 3ed5600a56e494d12e6ca700611c5fbb96710029..225aad1100a688a7aae50ac35349d8b1bce3da02 100644 (file)
@@ -1377,8 +1377,8 @@ class MarkClosureVisitor(CythonTransform):
         collector.visitchildren(node)
 
         if collector.yields:
-            for i, yield_expr in enumerate(collector.yields):
-                yield_expr.label_num = i + 1
+            for i, yield_expr in enumerate(collector.yields, 1):
+                yield_expr.label_num = i
 
             gbody = Nodes.GeneratorBodyDefNode(pos=node.pos,
                                                name=node.name,