Mercurial > hg
comparison mercurial/commandserver.py @ 40361:b7de186efd82
py3: don't use traceback.print_exc() in commandserver.py
It doesn't support a bytes stream on Python 3. This makes a traceback being
sent by one frame, but that shouldn't matter.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Tue, 16 Oct 2018 08:41:58 +0200 |
parents | 558114fa7bc1 |
children | 9683dfb6f13a 41f0529b5112 |
comparison
equal
deleted
inserted
replaced
40360:dee73a97e132 | 40361:b7de186efd82 |
---|---|
367 # see it because it is written to server's stderr by default. | 367 # see it because it is written to server's stderr by default. |
368 if sv: | 368 if sv: |
369 cerr = sv.cerr | 369 cerr = sv.cerr |
370 else: | 370 else: |
371 cerr = channeledoutput(fout, 'e') | 371 cerr = channeledoutput(fout, 'e') |
372 traceback.print_exc(file=cerr) | 372 cerr.write(encoding.strtolocal(traceback.format_exc())) |
373 raise | 373 raise |
374 finally: | 374 finally: |
375 fin.close() | 375 fin.close() |
376 try: | 376 try: |
377 fout.close() # implicit flush() may cause another EPIPE | 377 fout.close() # implicit flush() may cause another EPIPE |