diff --git a/mercurial/util.py b/mercurial/util.py index 8e02829bec6135f4ec96bb68b54de2c3f56dbc09_bWVyY3VyaWFsL3V0aWwucHk=..19b0fd4b5570f82818877a456f384cd3f15650b3_bWVyY3VyaWFsL3V0aWwucHk= 100644 --- a/mercurial/util.py +++ b/mercurial/util.py @@ -1033,11 +1033,8 @@ 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: @@ -1043,18 +1040,13 @@ 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): diff --git a/setup.py b/setup.py index 8e02829bec6135f4ec96bb68b54de2c3f56dbc09_c2V0dXAucHk=..19b0fd4b5570f82818877a456f384cd3f15650b3_c2V0dXAucHk= 100644 --- a/setup.py +++ b/setup.py @@ -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)