little tweak for looking up node children
authorStefan Behnel <scoder@users.berlios.de>
Sat, 20 Dec 2008 20:10:02 +0000 (21:10 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Sat, 20 Dec 2008 20:10:02 +0000 (21:10 +0100)
Cython/Compiler/ExprNodes.py

index 7db0030f34f2da596709f8398935008f649b7504..5c44f7d8ab18e960d0c4275ee39abea30eda5a92 100644 (file)
@@ -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") ###