summaryrefslogtreecommitdiff
path: root/pystache/parsed.py
diff options
context:
space:
mode:
authorChris Jerdonek <chris.jerdonek@gmail.com>2012-04-02 06:30:03 -0700
committerChris Jerdonek <chris.jerdonek@gmail.com>2012-04-02 19:24:19 -0700
commit1db59132e095e3d5a7cf33175c9e96f82b4c9901 (patch)
tree9e147efdf72edb68032602cee3bc856a674828e0 /pystache/parsed.py
parenta0b4e4fe2d01a8871ccd371a00155b8f475de44b (diff)
downloadpystache-1db59132e095e3d5a7cf33175c9e96f82b4c9901.tar.gz
Removed another use of the ternary operator for Python 2.4 support.
Diffstat (limited to 'pystache/parsed.py')
-rw-r--r--pystache/parsed.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/pystache/parsed.py b/pystache/parsed.py
index 12b5cb0..5418ec1 100644
--- a/pystache/parsed.py
+++ b/pystache/parsed.py
@@ -37,7 +37,11 @@ class ParsedTemplate(object):
Returns: a string of type unicode.
"""
- get_unicode = lambda val: val(context) if callable(val) else val
+ # We avoid use of the ternary operator for Python 2.4 support.
+ def get_unicode(val):
+ if callable(val):
+ return val(context)
+ return val
parts = map(get_unicode, self._parse_tree)
s = ''.join(parts)