diff options
author | Chris Jerdonek <chris.jerdonek@gmail.com> | 2012-04-02 06:30:03 -0700 |
---|---|---|
committer | Chris Jerdonek <chris.jerdonek@gmail.com> | 2012-04-02 19:24:19 -0700 |
commit | 1db59132e095e3d5a7cf33175c9e96f82b4c9901 (patch) | |
tree | 9e147efdf72edb68032602cee3bc856a674828e0 /pystache/parsed.py | |
parent | a0b4e4fe2d01a8871ccd371a00155b8f475de44b (diff) | |
download | pystache-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.py | 6 |
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) |