plan9: drop py26 hacks
authorMatt Harbison <matt_harbison@yahoo.com>
Fri, 16 Jun 2017 18:42:03 -0400
changeset 32904 19b0fd4b5570
parent 32903 8e02829bec61
child 32905 28a0e6a4e824
plan9: drop py26 hacks
mercurial/util.py
setup.py
--- a/mercurial/util.py	Sun Jun 18 12:25:23 2017 +0900
+++ b/mercurial/util.py	Fri Jun 16 18:42:03 2017 -0400
@@ -1033,28 +1033,20 @@
     except Exception:
         pass
     cmd = quotecommand(cmd)
-    if pycompat.sysplatform == 'plan9' and (sys.version_info[0] == 2
-                                    and sys.version_info[1] < 7):
-        # subprocess kludge to work around issues in half-baked Python
-        # ports, notably bichued/python:
-        if not cwd is None:
-            os.chdir(cwd)
-        rc = os.system(cmd)
+    env = shellenviron(environ)
+    if out is None or _isstdout(out):
+        rc = subprocess.call(cmd, shell=True, close_fds=closefds,
+                             env=env, cwd=cwd)
     else:
-        env = shellenviron(environ)
-        if out is None or _isstdout(out):
-            rc = subprocess.call(cmd, shell=True, close_fds=closefds,
-                                 env=env, cwd=cwd)
-        else:
-            proc = subprocess.Popen(cmd, shell=True, close_fds=closefds,
-                                    env=env, cwd=cwd, stdout=subprocess.PIPE,
-                                    stderr=subprocess.STDOUT)
-            for line in iter(proc.stdout.readline, ''):
-                out.write(line)
-            proc.wait()
-            rc = proc.returncode
-        if pycompat.sysplatform == 'OpenVMS' and rc & 1:
-            rc = 0
+        proc = subprocess.Popen(cmd, shell=True, close_fds=closefds,
+                                env=env, cwd=cwd, stdout=subprocess.PIPE,
+                                stderr=subprocess.STDOUT)
+        for line in iter(proc.stdout.readline, ''):
+            out.write(line)
+        proc.wait()
+        rc = proc.returncode
+    if pycompat.sysplatform == 'OpenVMS' and rc & 1:
+        rc = 0
     return rc
 
 def checksignature(func):
--- a/setup.py	Sun Jun 18 12:25:23 2017 +0900
+++ b/setup.py	Fri Jun 16 18:42:03 2017 -0400
@@ -143,17 +143,10 @@
     py2exeloaded = False
 
 def runcmd(cmd, env):
-    if (sys.platform == 'plan9'
-       and (sys.version_info[0] == 2 and sys.version_info[1] < 7)):
-        # subprocess kludge to work around issues in half-baked Python
-        # ports, notably bichued/python:
-        _, out, err = os.popen3(cmd)
-        return str(out), str(err)
-    else:
-        p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
-                             stderr=subprocess.PIPE, env=env)
-        out, err = p.communicate()
-        return out, err
+    p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
+                         stderr=subprocess.PIPE, env=env)
+    out, err = p.communicate()
+    return out, err
 
 def runhg(cmd, env):
     out, err = runcmd(cmd, env)