verify: fix exception formatting bug in Python 3
Differential Revision: https://phab.mercurial-scm.org/D2541
--- a/mercurial/verify.py Fri Mar 02 13:50:31 2018 -0500
+++ b/mercurial/verify.py Thu Mar 01 23:58:28 2018 -0500
@@ -70,9 +70,10 @@
self.errors += 1
def exc(self, linkrev, msg, inst, filename=None):
- if not str(inst):
- inst = repr(inst)
- self.err(linkrev, "%s: %s" % (msg, inst), filename)
+ fmsg = pycompat.bytestr(inst)
+ if not fmsg:
+ fmsg = pycompat.byterepr(inst)
+ self.err(linkrev, "%s: %s" % (msg, fmsg), filename)
def checklog(self, obj, name, linkrev):
if not len(obj) and (self.havecl or self.havemf):