Commit e0f14039 by Chris Jerdonek

Removed a use of the Python ternary operator (for Python 2.4 support).

parent fc9f9659
......@@ -138,8 +138,11 @@ class Renderer(object):
Convert a basestring to unicode, preserving any unicode subclass.
"""
# Avoid the "double-decoding" TypeError.
return s if isinstance(s, unicode) else self.unicode(s)
# We type-check to avoid "TypeError: decoding Unicode is not supported".
# We avoid the Python ternary operator for Python 2.4 support.
if isinstance(s, unicode):
return s
return self.unicode(s)
def _to_unicode_hard(self, s):
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment