changeset 40971: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 7654291091cf
children 2393c4044214
files mercurial/hook.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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: