Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/util.py @ 32904:19b0fd4b5570
plan9: drop py26 hacks
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Fri, 16 Jun 2017 18:42:03 -0400 |
parents | 1b25c648d5b7 |
children | ce96efec8112 |
comparison
equal
deleted
inserted
replaced
32903:8e02829bec61 | 32904:19b0fd4b5570 |
---|---|
1031 try: | 1031 try: |
1032 stdout.flush() | 1032 stdout.flush() |
1033 except Exception: | 1033 except Exception: |
1034 pass | 1034 pass |
1035 cmd = quotecommand(cmd) | 1035 cmd = quotecommand(cmd) |
1036 if pycompat.sysplatform == 'plan9' and (sys.version_info[0] == 2 | 1036 env = shellenviron(environ) |
1037 and sys.version_info[1] < 7): | 1037 if out is None or _isstdout(out): |
1038 # subprocess kludge to work around issues in half-baked Python | 1038 rc = subprocess.call(cmd, shell=True, close_fds=closefds, |
1039 # ports, notably bichued/python: | 1039 env=env, cwd=cwd) |
1040 if not cwd is None: | |
1041 os.chdir(cwd) | |
1042 rc = os.system(cmd) | |
1043 else: | 1040 else: |
1044 env = shellenviron(environ) | 1041 proc = subprocess.Popen(cmd, shell=True, close_fds=closefds, |
1045 if out is None or _isstdout(out): | 1042 env=env, cwd=cwd, stdout=subprocess.PIPE, |
1046 rc = subprocess.call(cmd, shell=True, close_fds=closefds, | 1043 stderr=subprocess.STDOUT) |
1047 env=env, cwd=cwd) | 1044 for line in iter(proc.stdout.readline, ''): |
1048 else: | 1045 out.write(line) |
1049 proc = subprocess.Popen(cmd, shell=True, close_fds=closefds, | 1046 proc.wait() |
1050 env=env, cwd=cwd, stdout=subprocess.PIPE, | 1047 rc = proc.returncode |
1051 stderr=subprocess.STDOUT) | 1048 if pycompat.sysplatform == 'OpenVMS' and rc & 1: |
1052 for line in iter(proc.stdout.readline, ''): | 1049 rc = 0 |
1053 out.write(line) | |
1054 proc.wait() | |
1055 rc = proc.returncode | |
1056 if pycompat.sysplatform == 'OpenVMS' and rc & 1: | |
1057 rc = 0 | |
1058 return rc | 1050 return rc |
1059 | 1051 |
1060 def checksignature(func): | 1052 def checksignature(func): |
1061 '''wrap a function with code to check for calling errors''' | 1053 '''wrap a function with code to check for calling errors''' |
1062 def check(*args, **kwargs): | 1054 def check(*args, **kwargs): |