Patchwork [2,of,3] py3: use pycompat.sysargv in dispatch.run()

login
register
mail settings
Submitter Pulkit Goyal
Date Nov. 21, 2016, 10:56 a.m.
Message ID <8439604b72091313a46c.1479725765@pulkit-goyal>
Download mbox | patch
Permalink /patch/17665/
State Accepted
Headers show

Comments

Pulkit Goyal - Nov. 21, 2016, 10:56 a.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1479722722 -19800
#      Mon Nov 21 15:35:22 2016 +0530
# Node ID 8439604b72091313a46ceac1d03caa1299e610ab
# Parent  05e95034383d926a46bf5dd72182a0f4ca8d6c62
py3: use pycompat.sysargv in dispatch.run()

Another one to have a bytes result from sys.argv in Python 3.
This one is also a part of running `hg version` on Python 3.

Patch

diff -r 05e95034383d -r 8439604b7209 mercurial/dispatch.py
--- a/mercurial/dispatch.py	Mon Nov 21 15:26:47 2016 +0530
+++ b/mercurial/dispatch.py	Mon Nov 21 15:35:22 2016 +0530
@@ -36,6 +36,7 @@ 
     hg,
     hook,
     profiling,
+    pycompat,
     revset,
     templatefilters,
     templatekw,
@@ -58,7 +59,7 @@ 
 
 def run():
     "run the command in sys.argv"
-    sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
+    sys.exit((dispatch(request(pycompat.sysargv[1:])) or 0) & 255)
 
 def _getsimilar(symbols, value):
     sim = lambda x: difflib.SequenceMatcher(None, value, x).ratio()