From a33d1b67153f3275007e5c5d06ef8995572f77cb Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 11 Jul 2008 15:34:27 +0200 Subject: [PATCH] micro fix for switch transform --- Cython/Compiler/Optimize.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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: -- 2.26.2