py3: use forcebytestr() to stringify hook exception
authorYuya Nishihara <yuya@tcha.org>
Sun, 16 Dec 2018 17:53:17 +0900
changeset 40971 8c8fcb385c46
parent 40970 7654291091cf
child 40972 2393c4044214
py3: use forcebytestr() to stringify hook exception This fixes test-narrow-exchange.t.
mercurial/hook.py
--- a/mercurial/hook.py	Sat Dec 15 23:14:03 2018 -0500
+++ b/mercurial/hook.py	Sun Dec 16 17:53:17 2018 +0900
@@ -102,7 +102,7 @@
                          (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: