Patchwork [1,of,6] py3: use %d instead of %s for integers

login
register
mail settings
Submitter Pulkit Goyal
Date Dec. 17, 2016, 3:41 p.m.
Message ID <ea408eb4d17eb54f68ff.1481989300@pulkit-goyal>
Download mbox | patch
Permalink /patch/17943/
State Accepted
Headers show

Comments

Pulkit Goyal - Dec. 17, 2016, 3:41 p.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1481983600 -19800
#      Sat Dec 17 19:36:40 2016 +0530
# Node ID ea408eb4d17eb54f68ffcbabb1c32cacfb64955d
# Parent  935092e525b0ee5656d0830162a1c2adf8248de3
py3: use %d instead of %s for integers

Python 3 returns an error if we use %s as type specifiers for integers.
Yuya Nishihara - Dec. 18, 2016, 9:10 a.m.
On Sat, 17 Dec 2016 21:11:40 +0530, Pulkit Goyal wrote:
> # HG changeset patch
> # User Pulkit Goyal <7895pulkit@gmail.com>
> # Date 1481983600 -19800
> #      Sat Dec 17 19:36:40 2016 +0530
> # Node ID ea408eb4d17eb54f68ffcbabb1c32cacfb64955d
> # Parent  935092e525b0ee5656d0830162a1c2adf8248de3
> py3: use %d instead of %s for integers

Queued with a minor style fix, thanks.

Patch

diff -r 935092e525b0 -r ea408eb4d17e mercurial/commands.py
--- a/mercurial/commands.py	Fri Dec 16 09:48:14 2016 -0800
+++ b/mercurial/commands.py	Sat Dec 17 19:36:40 2016 +0530
@@ -1892,7 +1892,7 @@ 
     fm.write('pythonexe', _("checking Python executable (%s)\n"),
              sys.executable)
     fm.write('pythonver', _("checking Python version (%s)\n"),
-             ("%s.%s.%s" % sys.version_info[:3]))
+             ("%d.%d.%d" % sys.version_info[:3]))
     fm.write('pythonlib', _("checking Python lib (%s)...\n"),
              os.path.dirname(os.__file__))