From 1db59132e095e3d5a7cf33175c9e96f82b4c9901 Mon Sep 17 00:00:00 2001 From: Chris Jerdonek Date: Mon, 2 Apr 2012 06:30:03 -0700 Subject: Removed another use of the ternary operator for Python 2.4 support. --- pystache/parsed.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'pystache/parsed.py') 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) -- cgit v1.2.1