comparison mercurial/hook.py @ 40984:8c8fcb385c46

py3: use forcebytestr() to stringify hook exception This fixes test-narrow-exchange.t.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 16 Dec 2018 17:53:17 +0900
parents 24e493ec2229
children 2372284d9457
comparison
equal deleted inserted replaced
40983:7654291091cf 40984:8c8fcb385c46
100 if isinstance(exc, error.Abort): 100 if isinstance(exc, error.Abort):
101 ui.warn(_('error: %s hook failed: %s\n') % 101 ui.warn(_('error: %s hook failed: %s\n') %
102 (hname, exc.args[0])) 102 (hname, exc.args[0]))
103 else: 103 else:
104 ui.warn(_('error: %s hook raised an exception: ' 104 ui.warn(_('error: %s hook raised an exception: '
105 '%s\n') % (hname, encoding.strtolocal(str(exc)))) 105 '%s\n') % (hname, stringutil.forcebytestr(exc)))
106 if throw: 106 if throw:
107 raise 107 raise
108 if not ui.tracebackflag: 108 if not ui.tracebackflag:
109 ui.warn(_('(run with --traceback for stack trace)\n')) 109 ui.warn(_('(run with --traceback for stack trace)\n'))
110 ui.traceback() 110 ui.traceback()