summaryrefslogtreecommitdiff
path: root/pystache/context.py
diff options
context:
space:
mode:
authorRodrigo Bernardo Pimentel <rbp@isnomore.net>2012-04-04 11:09:04 +0200
committerRodrigo Bernardo Pimentel <rbp@isnomore.net>2012-04-04 11:09:04 +0200
commit59771530b45a0af4b8a49d7fd17e57c53d4cfa84 (patch)
tree4fcd38f9e08876f288dfc2736e8ed8dc39b0d203 /pystache/context.py
parentd5df7f1536d50597ff81d665ca885fb9f36f49c6 (diff)
downloadpystache-59771530b45a0af4b8a49d7fd17e57c53d4cfa84.tar.gz
Bail early when the attribute is not found, when expanding dot-notation
Diffstat (limited to 'pystache/context.py')
-rw-r--r--pystache/context.py5
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