diff options
author | Philip Jenvey <pjenvey@underboss.org> | 2008-12-06 19:45:02 +0000 |
---|---|---|
committer | Philip Jenvey <pjenvey@underboss.org> | 2008-12-06 19:45:02 +0000 |
commit | dfe39f1ac85c7ec352c72ad6c63090a5af7f2ec2 (patch) | |
tree | 6e95e8fff896380401caa1f98d4e3f37e135ac23 | |
parent | 1c7f13a492f92f3e70a2a7fa42882423d833dcf2 (diff) | |
download | mako-rel_0_2_4.tar.gz |
reapply the _fields check, it's needed for CPython 2.5rel_0_2_4
-rw-r--r-- | lib/mako/_ast_util.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/mako/_ast_util.py b/lib/mako/_ast_util.py index 706425c..6ff4ab9 100644 --- a/lib/mako/_ast_util.py +++ b/lib/mako/_ast_util.py @@ -171,6 +171,9 @@ def increment_lineno(node, n=1): def iter_fields(node): """Iterate over all fields of a node, only yielding existing fields.""" + # CPython 2.5 compat + if not hasattr(node, '_fields') or not node._fields: + return for field in node._fields: try: yield field, getattr(node, field) |