# HG changeset patch # User Matt Mackall # Date 2006-11-13 19:26:57 # Node ID bf3dec184c78f5d74628d35b332a808a19f05b56 # Parent 231393b7316f22f0504b5b22fb3ea9ea191bc1ea templater: remove cStringIO for fill diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -204,11 +204,8 @@ def fill(text, width): yield text[start:m.start(0)], m.group(1) start = m.end(1) - fp = cStringIO.StringIO() - for para, rest in findparas(): - fp.write(space_re.sub(' ', textwrap.fill(para, width))) - fp.write(rest) - return fp.getvalue() + return "".join([space_re.sub(' ', textwrap.fill(para, width)) + rest + for para, rest in findparas()]) def firstline(text): '''return the first line of text'''