Show More
@@ -11,7 +11,22 b' import difflib' | |||
|
11 | 11 | import errno |
|
12 | 12 | import optparse |
|
13 | 13 | import os |
|
14 | import popen2 | |
|
14 | try: | |
|
15 | import subprocess | |
|
16 | subprocess.Popen # trigger ImportError early | |
|
17 | closefds = os.name == 'posix' | |
|
18 | def Popen4(cmd, bufsize=-1): | |
|
19 | p = subprocess.Popen(cmd, shell=True, bufsize=bufsize, | |
|
20 | close_fds=closefds, | |
|
21 | stdin=subprocess.PIPE, stdout=subprocess.PIPE, | |
|
22 | stderr=subprocess.STDOUT) | |
|
23 | p.fromchild = p.stdout | |
|
24 | p.tochild = p.stdin | |
|
25 | p.childerr = p.stderr | |
|
26 | return p | |
|
27 | except ImportError: | |
|
28 | subprocess = None | |
|
29 | from popen2 import Popen4 | |
|
15 | 30 | import shutil |
|
16 | 31 | import signal |
|
17 | 32 | import sys |
@@ -281,7 +296,7 b' def run(cmd):' | |||
|
281 | 296 | if ret == None: |
|
282 | 297 | ret = 0 |
|
283 | 298 | else: |
|
284 |
proc = |
|
|
299 | proc = Popen4(cmd) | |
|
285 | 300 | try: |
|
286 | 301 | output = '' |
|
287 | 302 | proc.tochild.close() |
General Comments 0
You need to be logged in to leave comments.
Login now