summaryrefslogtreecommitdiff
path: root/pystache/parsed.py
diff options
context:
space:
mode:
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)