Mercurial > hg
comparison mercurial/dispatch.py @ 36124:976a9fd706ed
py3: convert traceback representation to bytes when logging
Python's APIs should return a system string. We want to use bytes
for logging. So convert the traceback to bytes before sending
it to the logger.
Differential Revision: https://phab.mercurial-scm.org/D2176
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 11 Feb 2018 19:43:43 -0800 |
parents | f81df691efe7 |
children | 8b662717c53f |
comparison
equal
deleted
inserted
replaced
36123:8eb13f5d5d3f | 36124:976a9fd706ed |
---|---|
990 | 990 |
991 Called when handling an exception; the exception is reraised if | 991 Called when handling an exception; the exception is reraised if |
992 this function returns False, ignored otherwise. | 992 this function returns False, ignored otherwise. |
993 """ | 993 """ |
994 warning = _exceptionwarning(ui) | 994 warning = _exceptionwarning(ui) |
995 ui.log("commandexception", "%s\n%s\n", warning, traceback.format_exc()) | 995 ui.log("commandexception", "%s\n%s\n", warning, |
996 pycompat.sysbytes(traceback.format_exc())) | |
996 ui.warn(warning) | 997 ui.warn(warning) |
997 return False # re-raise the exception | 998 return False # re-raise the exception |