From 5c7265d7ef0895e7c0d3e70a01eefc6271a16e2d Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Tue, 21 Oct 2008 15:47:41 -0700 Subject: [PATCH] Fix switch optimization for attributes --- Cython/Compiler/Optimize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cython/Compiler/Optimize.py b/Cython/Compiler/Optimize.py index 2e464149..84f7d4e3 100644 --- a/Cython/Compiler/Optimize.py +++ b/Cython/Compiler/Optimize.py @@ -14,7 +14,7 @@ def is_common_value(a, b): if isinstance(a, ExprNodes.NameNode) and isinstance(b, ExprNodes.NameNode): return a.name == b.name if isinstance(a, ExprNodes.AttributeNode) and isinstance(b, ExprNodes.AttributeNode): - return not a.is_py_attr and is_common_value(a.obj, b.obj) + return not a.is_py_attr and is_common_value(a.obj, b.obj) and a.attribute == b.attribute return False -- 2.26.2