py3: remove a couple of superfluous calls to pycompat.rapply()
authorMatt Harbison <matt_harbison@yahoo.com>
Tue, 25 Sep 2018 23:25:36 -0400
changeset 39841 f1d6021453c2
parent 39840 91d63fd58e7d
child 39842 69b4a5b89dc5
py3: remove a couple of superfluous calls to pycompat.rapply() These places can only be strings.
hgext/convert/common.py
hgext/fix.py
hgext/logtoprocess.py
mercurial/scmutil.py
mercurial/utils/procutil.py
--- a/hgext/convert/common.py	Tue Sep 25 22:11:17 2018 -0400
+++ b/hgext/convert/common.py	Tue Sep 25 23:25:36 2018 -0400
@@ -402,7 +402,7 @@
 
     def _run(self, cmd, *args, **kwargs):
         def popen(cmdline):
-            p = subprocess.Popen(pycompat.rapply(procutil.tonativestr, cmdline),
+            p = subprocess.Popen(procutil.tonativestr(cmdline),
                                  shell=True, bufsize=-1,
                                  close_fds=procutil.closefds,
                                  stdout=subprocess.PIPE)
--- a/hgext/fix.py	Tue Sep 25 22:11:17 2018 -0400
+++ b/hgext/fix.py	Tue Sep 25 23:25:36 2018 -0400
@@ -452,7 +452,7 @@
                 continue
             ui.debug('subprocess: %s\n' % (command,))
             proc = subprocess.Popen(
-                pycompat.rapply(procutil.tonativestr, command),
+                procutil.tonativestr(command),
                 shell=True,
                 cwd=procutil.tonativestr(b'/'),
                 stdin=subprocess.PIPE,
--- a/hgext/logtoprocess.py	Tue Sep 25 22:11:17 2018 -0400
+++ b/hgext/logtoprocess.py	Tue Sep 25 23:25:36 2018 -0400
@@ -66,7 +66,7 @@
             # we can't use close_fds *and* redirect stdin. I'm not sure that we
             # need to because the detached process has no console connection.
             subprocess.Popen(
-                pycompat.rapply(procutil.tonativestr, script),
+                procutil.tonativestr(script),
                 shell=True, env=procutil.tonativeenv(env), close_fds=True,
                 creationflags=_creationflags)
     else:
@@ -87,7 +87,7 @@
                 # connect stdin to devnull to make sure the subprocess can't
                 # muck up that stream for mercurial.
                 subprocess.Popen(
-                    pycompat.rapply(procutil.tonativestr, script),
+                    procutil.tonativestr(script),
                     shell=True, stdin=open(os.devnull, 'r'),
                     env=procutil.tonativeenv(env),
                     close_fds=True, **newsession)
--- a/mercurial/scmutil.py	Tue Sep 25 22:11:17 2018 -0400
+++ b/mercurial/scmutil.py	Tue Sep 25 23:25:36 2018 -0400
@@ -1339,7 +1339,7 @@
         if spec.startswith("shell:"):
             # external commands should be run relative to the repo root
             cmd = spec[6:]
-            proc = subprocess.Popen(pycompat.rapply(procutil.tonativestr, cmd),
+            proc = subprocess.Popen(procutil.tonativestr(cmd),
                                     shell=True, bufsize=-1,
                                     close_fds=procutil.closefds,
                                     stdout=subprocess.PIPE,
--- a/mercurial/utils/procutil.py	Tue Sep 25 22:11:17 2018 -0400
+++ b/mercurial/utils/procutil.py	Tue Sep 25 23:25:36 2018 -0400
@@ -137,7 +137,7 @@
     # Setting bufsize to -1 lets the system decide the buffer size.
     # The default for bufsize is 0, meaning unbuffered. This leads to
     # poor performance on Mac OS X: http://bugs.python.org/issue4194
-    p = subprocess.Popen(pycompat.rapply(tonativestr, cmd),
+    p = subprocess.Popen(tonativestr(cmd),
                          shell=True, bufsize=-1,
                          close_fds=closefds,
                          stdin=subprocess.PIPE, stdout=subprocess.PIPE,
@@ -149,7 +149,7 @@
     return stdin, stdout, stderr
 
 def popen4(cmd, env=None, bufsize=-1):
-    p = subprocess.Popen(pycompat.rapply(tonativestr, cmd),
+    p = subprocess.Popen(tonativestr(cmd),
                          shell=True, bufsize=bufsize,
                          close_fds=closefds,
                          stdin=subprocess.PIPE, stdout=subprocess.PIPE,
@@ -159,7 +159,7 @@
 
 def pipefilter(s, cmd):
     '''filter string S through command CMD, returning its output'''
-    p = subprocess.Popen(pycompat.rapply(tonativestr, cmd),
+    p = subprocess.Popen(tonativestr(cmd),
                          shell=True, close_fds=closefds,
                          stdin=subprocess.PIPE, stdout=subprocess.PIPE)
     pout, perr = p.communicate(s)
@@ -351,12 +351,12 @@
     cmd = quotecommand(cmd)
     env = shellenviron(environ)
     if out is None or isstdout(out):
-        rc = subprocess.call(pycompat.rapply(tonativestr, cmd),
+        rc = subprocess.call(tonativestr(cmd),
                              shell=True, close_fds=closefds,
                              env=tonativeenv(env),
                              cwd=pycompat.rapply(tonativestr, cwd))
     else:
-        proc = subprocess.Popen(pycompat.rapply(tonativestr, cmd),
+        proc = subprocess.Popen(tonativestr(cmd),
                                 shell=True, close_fds=closefds,
                                 env=tonativeenv(env),
                                 cwd=pycompat.rapply(tonativestr, cwd),