diff 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
line wrap: on
line diff
--- 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: