comparison mercurial/ui.py @ 35937:4b1c04082cdc

py3: replace "if ispy3" by encoding.strtolocal()
author Yuya Nishihara <yuya@tcha.org>
date Sat, 27 Jan 2018 13:09:49 +0900
parents e49c39ffeac2
children 72de5c504833
comparison
equal deleted inserted replaced
35936:ed3a7300b7b5 35937:4b1c04082cdc
1506 ''.join(exctb[:-1]), 1506 ''.join(exctb[:-1]),
1507 ''.join(causetb), 1507 ''.join(causetb),
1508 ''.join(exconly)) 1508 ''.join(exconly))
1509 else: 1509 else:
1510 output = traceback.format_exception(exc[0], exc[1], exc[2]) 1510 output = traceback.format_exception(exc[0], exc[1], exc[2])
1511 data = r''.join(output) 1511 self.write_err(encoding.strtolocal(r''.join(output)))
1512 if pycompat.ispy3:
1513 enc = pycompat.sysstr(encoding.encoding)
1514 data = data.encode(enc, errors=r'replace')
1515 self.write_err(data)
1516 return self.tracebackflag or force 1512 return self.tracebackflag or force
1517 1513
1518 def geteditor(self): 1514 def geteditor(self):
1519 '''return editor to use''' 1515 '''return editor to use'''
1520 if pycompat.sysplatform == 'plan9': 1516 if pycompat.sysplatform == 'plan9':