Show More
@@ -51,18 +51,22 b' def sha1(s):' | |||
|
51 | 51 | |
|
52 | 52 | try: |
|
53 | 53 | import subprocess |
|
54 | closefds = os.name == 'posix' | |
|
54 | 55 | def popen2(cmd, mode='t', bufsize=-1): |
|
55 |
p = subprocess.Popen(cmd, shell=True, bufsize=bufsize, |
|
|
56 | p = subprocess.Popen(cmd, shell=True, bufsize=bufsize, | |
|
57 | close_fds=closefds, | |
|
56 | 58 | stdin=subprocess.PIPE, stdout=subprocess.PIPE) |
|
57 | 59 | return p.stdin, p.stdout |
|
58 | 60 | def popen3(cmd, mode='t', bufsize=-1): |
|
59 |
p = subprocess.Popen(cmd, shell=True, bufsize=bufsize, |
|
|
61 | p = subprocess.Popen(cmd, shell=True, bufsize=bufsize, | |
|
62 | close_fds=closefds, | |
|
60 | 63 | stdin=subprocess.PIPE, stdout=subprocess.PIPE, |
|
61 | 64 | stderr=subprocess.PIPE) |
|
62 | 65 | return p.stdin, p.stdout, p.stderr |
|
63 | 66 | def Popen3(cmd, capturestderr=False, bufsize=-1): |
|
64 | 67 | stderr = capturestderr and subprocess.PIPE or None |
|
65 |
p = subprocess.Popen(cmd, shell=True, bufsize=bufsize, |
|
|
68 | p = subprocess.Popen(cmd, shell=True, bufsize=bufsize, | |
|
69 | close_fds=closefds, | |
|
66 | 70 | stdin=subprocess.PIPE, stdout=subprocess.PIPE, |
|
67 | 71 | stderr=stderr) |
|
68 | 72 | p.fromchild = p.stdout |
General Comments 0
You need to be logged in to leave comments.
Login now