py3: use bytestr() to coerce position carried by ParseError to string
authorYuya Nishihara <yuya@tcha.org>
Thu, 01 Mar 2018 08:45:34 -0500
changeset 36503 8b662717c53f
parent 36502 faaabe0dc4d1
child 36504 b075f45456a5
py3: use bytestr() to coerce position carried by ParseError to string The position value is either int or byte string.
mercurial/dispatch.py
--- a/mercurial/dispatch.py	Thu Mar 01 08:38:39 2018 -0500
+++ b/mercurial/dispatch.py	Thu Mar 01 08:45:34 2018 -0500
@@ -132,7 +132,7 @@
         similar = _getsimilar(inst.symbols, inst.function)
     if len(inst.args) > 1:
         write(_("hg: parse error at %s: %s\n") %
-                         (inst.args[1], inst.args[0]))
+              (pycompat.bytestr(inst.args[1]), inst.args[0]))
         if (inst.args[0][0] == ' '):
             write(_("unexpected leading whitespace\n"))
     else: