From: Stefan Behnel Date: Sat, 20 Dec 2008 20:10:02 +0000 (+0100) Subject: little tweak for looking up node children X-Git-Tag: 0.11-beta~93 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=068e22c37febfc4ab515069fd8d6d67dff2f1a4a;p=cython.git little tweak for looking up node children --- 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") ###