From: Robert Bradshaw Date: Tue, 21 Oct 2008 22:47:41 +0000 (-0700) Subject: Fix switch optimization for attributes X-Git-Tag: 0.9.9.2.beta~30 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5c7265d7ef0895e7c0d3e70a01eefc6271a16e2d;p=cython.git Fix switch optimization for attributes --- 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