From 068e22c37febfc4ab515069fd8d6d67dff2f1a4a Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sat, 20 Dec 2008 21:10:02 +0100 Subject: [PATCH] little tweak for looking up node children --- Cython/Compiler/ExprNodes.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 7db0030f..5c44f7d8 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -182,9 +182,13 @@ class ExprNode(Node): constant_result = constant_value_not_set - def get_child_attrs(self): - return self.subexprs - child_attrs = property(fget=get_child_attrs) + try: + _get_child_attrs = operator.attrgetter('subexprs') + except AttributeError: + # Python 2.3 + def _get_child_attrs(self): + return self.subexprs + child_attrs = property(fget=_get_child_attrs) def not_implemented(self, method_name): print_call_chain(method_name, "not implemented") ### -- 2.26.2