micro fix for switch transform
authorStefan Behnel <scoder@users.berlios.de>
Fri, 11 Jul 2008 13:34:27 +0000 (15:34 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Fri, 11 Jul 2008 13:34:27 +0000 (15:34 +0200)
Cython/Compiler/Optimize.py

index a62f108875e58dd33a5145c3ce678b29dccf52ad..77a26a823f55cd67c7ca49d78bb8fdb50d673e3e 100644 (file)
@@ -100,9 +100,9 @@ class FlattenInListTransform(Visitor.VisitorTransform):
             eq_or_neq = '!='
         else:
             return node
-            
-        args = node.operand2.args
+
         if isinstance(node.operand2, ExprNodes.TupleNode) or isinstance(node.operand2, ExprNodes.ListNode):
+            args = node.operand2.args
             if len(args) == 0:
                 return ExprNodes.BoolNode(pos = node.pos, value = node.operator == 'not_in')
             else: