Workaround for T441, enumerate optimization bug.
authorRobert Bradshaw <robertwb@math.washington.edu>
Thu, 29 Oct 2009 07:59:03 +0000 (00:59 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Thu, 29 Oct 2009 07:59:03 +0000 (00:59 -0700)
Cython/Compiler/Optimize.py

index 0cff21b97a52bd3949e19004e0f2a4a40828917d..c422f8da543ec374c64cb5f34a68eb330ab109ab 100644 (file)
@@ -236,6 +236,10 @@ class IterationTransform(Visitor.VisitorTransform):
         if not counter_type.is_pyobject and not counter_type.is_int:
             # nothing we can do here, I guess
             return node
+        
+        if iterable_target.type is not PyrexTypes.py_object_type:
+            # this may need conversion, could be made to work
+            return node
 
         temp = UtilNodes.LetRefNode(ExprNodes.IntNode(enumerate_function.pos,
                                                       value='0',