From: Stefan Behnel Date: Fri, 11 Jul 2008 13:34:27 +0000 (+0200) Subject: micro fix for switch transform X-Git-Tag: 0.9.8.1~123^2~18 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a33d1b67153f3275007e5c5d06ef8995572f77cb;p=cython.git micro fix for switch transform --- diff --git a/Cython/Compiler/Optimize.py b/Cython/Compiler/Optimize.py index a62f1088..77a26a82 100644 --- a/Cython/Compiler/Optimize.py +++ b/Cython/Compiler/Optimize.py @@ -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: