server: use pycompat to get argv
authorAugie Fackler <raf@durin42.com>
Sun, 28 May 2017 15:43:26 -0400
changeset 37743 3f0936b2cea96ee895373bc2dc1a8b326a4542ff
parent 37742 0ec17613582cae98ee57c13f3329226be27ecc16
child 37744 7236facefd4fe94c95d1af82aa8c40d33b48b900
push id525
push usergszorc@mozilla.com
push dateFri, 09 Jun 2017 06:37:32 +0000
server: use pycompat to get argv
mercurial/server.py
--- a/mercurial/server.py
+++ b/mercurial/server.py
@@ -3,27 +3,27 @@
 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
 #
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
 
 from __future__ import absolute_import
 
 import os
-import sys
 import tempfile
 
 from .i18n import _
 
 from . import (
     chgserver,
     cmdutil,
     commandserver,
     error,
     hgweb,
+    pycompat,
     util,
 )
 
 def runservice(opts, parentfn=None, initfn=None, runfn=None, logfile=None,
                runargs=None, appendpid=False):
     '''Run a command as a service.'''
 
     def writepid(pid):
@@ -37,17 +37,17 @@ def runservice(opts, parentfn=None, init
             fp.close()
 
     if opts['daemon'] and not opts['daemon_postexec']:
         # Signal child process startup with file removal
         lockfd, lockpath = tempfile.mkstemp(prefix='hg-service-')
         os.close(lockfd)
         try:
             if not runargs:
-                runargs = util.hgcmd() + sys.argv[1:]
+                runargs = util.hgcmd() + pycompat.sysargv[1:]
             runargs.append('--daemon-postexec=unlink:%s' % lockpath)
             # Don't pass --cwd to the child process, because we've already
             # changed directory.
             for i in xrange(1, len(runargs)):
                 if runargs[i].startswith('--cwd='):
                     del runargs[i]
                     break
                 elif runargs[i].startswith('--cwd'):