[PATCH 04 of 10 py3] parser: use %d instead of %s for interpolating error position

Augie Fackler raf at durin42.com
Sun Mar 12 14:57:44 EDT 2017


# HG changeset patch
# User Augie Fackler <augie at google.com>
# Date 1489297499 18000
#      Sun Mar 12 00:44:59 2017 -0500
# Node ID 74e974791be1479b80c6fd42923d999b9c2891a2
# Parent  ecf0bd03ed286a87a7cac46594a241b65e130abf
parser: use %d instead of %s for interpolating error position

Error position is an int, so we should use %d instead of %s. Fixes
failures on Python 3.

diff --git a/mercurial/parser.py b/mercurial/parser.py
--- a/mercurial/parser.py
+++ b/mercurial/parser.py
@@ -265,7 +265,7 @@ def parseerrordetail(inst):
     """Compose error message from specified ParseError object
     """
     if len(inst.args) > 1:
-        return _('at %s: %s') % (inst.args[1], inst.args[0])
+        return _('at %d: %s') % (inst.args[1], inst.args[0])
     else:
         return inst.args[0]
 


More information about the Mercurial-devel mailing list