##// END OF EJS Templates
templatefilters: avoid infinite recursion bug in stringify...
Augie Fackler -
r36591:9b6b02a5 default
parent child Browse files
Show More
@@ -376,6 +376,12 b' def stringify(thing):'
376 """
376 """
377 thing = templatekw.unwraphybrid(thing)
377 thing = templatekw.unwraphybrid(thing)
378 if util.safehasattr(thing, '__iter__') and not isinstance(thing, bytes):
378 if util.safehasattr(thing, '__iter__') and not isinstance(thing, bytes):
379 if isinstance(thing, str):
380 # This is only reachable on Python 3 (otherwise
381 # isinstance(thing, bytes) would have been true), and is
382 # here to prevent infinite recursion bugs on Python 3.
383 raise error.ProgrammingError(
384 'stringify got unexpected unicode string: %r' % thing)
379 return "".join([stringify(t) for t in thing if t is not None])
385 return "".join([stringify(t) for t in thing if t is not None])
380 if thing is None:
386 if thing is None:
381 return ""
387 return ""
General Comments 0
You need to be logged in to leave comments. Login now