comparison mercurial/ui.py @ 31178:81e289ef9376

ui: fix ui.traceback on Python 3
author Augie Fackler <raf@durin42.com>
date Fri, 03 Mar 2017 14:09:14 -0500
parents a7cabac20b62
children 64596338ba10
comparison
equal deleted inserted replaced
31177:a7cabac20b62 31178:81e289ef9376
1334 ''.join(exctb[:-1]), 1334 ''.join(exctb[:-1]),
1335 ''.join(causetb), 1335 ''.join(causetb),
1336 ''.join(exconly)) 1336 ''.join(exconly))
1337 else: 1337 else:
1338 output = traceback.format_exception(exc[0], exc[1], exc[2]) 1338 output = traceback.format_exception(exc[0], exc[1], exc[2])
1339 self.write_err(''.join(output)) 1339 data = r''.join(output)
1340 if pycompat.ispy3:
1341 enc = pycompat.sysstr(encoding.encoding)
1342 data = data.encode(enc, errors=r'replace')
1343 self.write_err(data)
1340 return self.tracebackflag or force 1344 return self.tracebackflag or force
1341 1345
1342 def geteditor(self): 1346 def geteditor(self):
1343 '''return editor to use''' 1347 '''return editor to use'''
1344 if pycompat.sysplatform == 'plan9': 1348 if pycompat.sysplatform == 'plan9':