templatefilters: strings are iterators, but shouldn't be joined anyway
authorDirkjan Ochtman <dirkjan@ochtman.nl>
Mon, 06 Apr 2009 16:26:57 +0200
changeset 8015 b5db7dcc1497
parent 8014 6a77ba181bc6
child 8017 685ce2f7ee35
templatefilters: strings are iterators, but shouldn't be joined anyway
mercurial/templater.py
--- a/mercurial/templater.py	Mon Apr 06 10:51:45 2009 +0200
+++ b/mercurial/templater.py	Mon Apr 06 16:26:57 2009 +0200
@@ -209,6 +209,6 @@
 
 def stringify(thing):
     '''turn nested template iterator into string.'''
-    if hasattr(thing, '__iter__'):
+    if hasattr(thing, '__iter__') and not isinstance(thing, str):
         return "".join([stringify(t) for t in thing if t is not None])
     return str(thing)