fix switch transform after changing boolean coercion of integer expressions
authorStefan Behnel <stefan_ml@behnel.de>
Sun, 21 Apr 2013 06:04:31 +0000 (08:04 +0200)
committerStefan Behnel <stefan_ml@behnel.de>
Sun, 21 Apr 2013 06:04:31 +0000 (08:04 +0200)
Cython/Compiler/Optimize.py

index c381195..c560cfe 100644 (file)
@@ -778,7 +778,8 @@ class SwitchTransform(Visitor.VisitorTransform):
 
     def extract_conditions(self, cond, allow_not_in):
         while True:
-            if isinstance(cond, ExprNodes.CoerceToTempNode):
+            if isinstance(cond, (ExprNodes.CoerceToTempNode,
+                                 ExprNodes.CoerceToBooleanNode)):
                 cond = cond.arg
             elif isinstance(cond, UtilNodes.EvalWithTempExprNode):
                 # this is what we get from the FlattenInListTransform