Show More
@@ -1033,28 +1033,20 b' def system(cmd, environ=None, cwd=None, ' | |||||
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): |
@@ -143,17 +143,10 b' except ImportError:' | |||||
143 | py2exeloaded = False |
|
143 | py2exeloaded = False | |
144 |
|
144 | |||
145 | def runcmd(cmd, env): |
|
145 | def runcmd(cmd, env): | |
146 | if (sys.platform == 'plan9' |
|
146 | p = subprocess.Popen(cmd, stdout=subprocess.PIPE, | |
147 | and (sys.version_info[0] == 2 and sys.version_info[1] < 7)): |
|
147 | stderr=subprocess.PIPE, env=env) | |
148 | # subprocess kludge to work around issues in half-baked Python |
|
148 | out, err = p.communicate() | |
149 | # ports, notably bichued/python: |
|
149 | return out, err | |
150 | _, out, err = os.popen3(cmd) |
|
|||
151 | return str(out), str(err) |
|
|||
152 | else: |
|
|||
153 | p = subprocess.Popen(cmd, stdout=subprocess.PIPE, |
|
|||
154 | stderr=subprocess.PIPE, env=env) |
|
|||
155 | out, err = p.communicate() |
|
|||
156 | return out, err |
|
|||
157 |
|
150 | |||
158 | def runhg(cmd, env): |
|
151 | def runhg(cmd, env): | |
159 | out, err = runcmd(cmd, env) |
|
152 | out, err = runcmd(cmd, env) |
General Comments 0
You need to be logged in to leave comments.
Login now