Mercurial > hg-stable
changeset 32904:19b0fd4b5570
plan9: drop py26 hacks
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Fri, 16 Jun 2017 18:42:03 -0400 |
parents | 8e02829bec61 |
children | 28a0e6a4e824 |
files | mercurial/util.py setup.py |
diffstat | 2 files changed, 17 insertions(+), 32 deletions(-) [+] |
line wrap: on
line diff
--- 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)