From: Robert Bradshaw Date: Thu, 29 Oct 2009 07:59:03 +0000 (-0700) Subject: Workaround for T441, enumerate optimization bug. X-Git-Tag: 0.12.alpha0~8^2~22 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=91d3c9fcc005bd6cacbe75d251020dd18e8bcd62;p=cython.git Workaround for T441, enumerate optimization bug. --- diff --git a/Cython/Compiler/Optimize.py b/Cython/Compiler/Optimize.py index 0cff21b9..c422f8da 100644 --- a/Cython/Compiler/Optimize.py +++ b/Cython/Compiler/Optimize.py @@ -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',