# HG changeset patch # User Yuya Nishihara # Date 2018-12-16 08:53:17 # Node ID 8c8fcb385c46890e1dc5d00ce3ced360974cecef # Parent 7654291091cf35aade1d8e628def25a2fc3b567a py3: use forcebytestr() to stringify hook exception This fixes test-narrow-exchange.t. diff --git a/mercurial/hook.py b/mercurial/hook.py --- a/mercurial/hook.py +++ b/mercurial/hook.py @@ -102,7 +102,7 @@ def pythonhook(ui, repo, htype, hname, f (hname, exc.args[0])) else: ui.warn(_('error: %s hook raised an exception: ' - '%s\n') % (hname, encoding.strtolocal(str(exc)))) + '%s\n') % (hname, stringutil.forcebytestr(exc))) if throw: raise if not ui.tracebackflag: