comparison mercurial/formatter.py @ 36265:b44fac3a49fb

py3: factor out byterepr() which returns an asciified value on py3
author Yuya Nishihara <yuya@tcha.org>
date Sat, 17 Feb 2018 18:09:56 +0900
parents 0fb0c304ebd6
children e8d37838f5df
comparison
equal deleted inserted replaced
36264:18e29c65bc5c 36265:b44fac3a49fb
289 def __init__(self, ui, out, topic, opts): 289 def __init__(self, ui, out, topic, opts):
290 baseformatter.__init__(self, ui, topic, opts, _nullconverter) 290 baseformatter.__init__(self, ui, topic, opts, _nullconverter)
291 self._out = out 291 self._out = out
292 self._out.write("%s = [\n" % self._topic) 292 self._out.write("%s = [\n" % self._topic)
293 def _showitem(self): 293 def _showitem(self):
294 self._out.write(' %s,\n' % pycompat.sysbytes(repr(self._item))) 294 self._out.write(' %s,\n' % pycompat.byterepr(self._item))
295 def end(self): 295 def end(self):
296 baseformatter.end(self) 296 baseformatter.end(self)
297 self._out.write("]\n") 297 self._out.write("]\n")
298 298
299 class pickleformatter(baseformatter): 299 class pickleformatter(baseformatter):