Mercurial > public > mercurial-scm > hg-stable
diff mercurial/crecord.py @ 28861:86db5cb55d46
pycompat: switch to util.stringio for py3 compat
author | timeless <timeless@mozdev.org> |
---|---|
date | Sun, 10 Apr 2016 20:55:37 +0000 |
parents | 44319097e7b9 |
children | ee56a86e2782 |
line wrap: on
line diff
--- a/mercurial/crecord.py Sun Apr 10 21:32:08 2016 +0000 +++ b/mercurial/crecord.py Sun Apr 10 20:55:37 2016 +0000 @@ -10,7 +10,6 @@ from __future__ import absolute_import -import cStringIO import locale import os import re @@ -25,6 +24,7 @@ patch as patchmod, util, ) +stringio = util.stringio # This is required for ncurses to display non-ASCII characters in default user # locale encoding correctly. --immerrr @@ -238,7 +238,7 @@ def prettystr(self): - x = cStringIO.StringIO() + x = stringio() self.pretty(x) return x.getvalue() @@ -449,7 +449,7 @@ pretty = write def prettystr(self): - x = cStringIO.StringIO() + x = stringio() self.pretty(x) return x.getvalue() @@ -1506,7 +1506,7 @@ return None # write the initial patch - patch = cStringIO.StringIO() + patch = stringio() patch.write(diffhelptext + hunkhelptext) chunk.header.write(patch) chunk.write(patch)