diff options
author | Rodrigo Bernardo Pimentel <rbp@isnomore.net> | 2012-04-04 11:09:04 +0200 |
---|---|---|
committer | Rodrigo Bernardo Pimentel <rbp@isnomore.net> | 2012-04-04 11:09:04 +0200 |
commit | 59771530b45a0af4b8a49d7fd17e57c53d4cfa84 (patch) | |
tree | 4fcd38f9e08876f288dfc2736e8ed8dc39b0d203 /pystache | |
parent | d5df7f1536d50597ff81d665ca885fb9f36f49c6 (diff) | |
download | pystache-59771530b45a0af4b8a49d7fd17e57c53d4cfa84.tar.gz |
Bail early when the attribute is not found, when expanding dot-notation
Diffstat (limited to 'pystache')
-rw-r--r-- | pystache/context.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pystache/context.py b/pystache/context.py index 6e75c07..2ebf549 100644 --- a/pystache/context.py +++ b/pystache/context.py @@ -54,8 +54,9 @@ def _get_value(item, key): value = attr for part in parts[1:]: - if value is not _NOT_FOUND: - value = _get_value(value, part) + if value is _NOT_FOUND: + break + value = _get_value(value, part) return value |