Mercurial > genshi > mirror
diff markup/eval.py @ 42:28ddb79414b2 trunk
Catch `KeyError` exception when trying attribute access in expression evaluation.
author | cmlenz |
---|---|
date | Mon, 03 Jul 2006 21:50:56 +0000 |
parents | 2224a52256ca |
children | 59eb24184e9c |
line wrap: on
line diff
--- a/markup/eval.py +++ b/markup/eval.py @@ -125,7 +125,7 @@ return getattr(obj, node.attrname) try: return obj[node.attrname] - except TypeError: + except (KeyError, TypeError): return None def _visit_slice(self, node, data): @@ -265,7 +265,7 @@ return getattr(obj, node.attr) try: return obj[node.attr] - except TypeError: + except (KeyError, TypeError): return None def _visit_call(self, node, data):