Show More
@@ -128,27 +128,25 b' def _popenwriter(cmd, bufsize):' | |||||
128 | stdin=subprocess.PIPE) |
|
128 | stdin=subprocess.PIPE) | |
129 | return _pfile(p, p.stdin) |
|
129 | return _pfile(p, p.stdin) | |
130 |
|
130 | |||
131 |
def popen2(cmd, env=None |
|
131 | def popen2(cmd, env=None): | |
132 | # Setting bufsize to -1 lets the system decide the buffer size. |
|
132 | # Setting bufsize to -1 lets the system decide the buffer size. | |
133 | # The default for bufsize is 0, meaning unbuffered. This leads to |
|
133 | # The default for bufsize is 0, meaning unbuffered. This leads to | |
134 | # poor performance on Mac OS X: http://bugs.python.org/issue4194 |
|
134 | # poor performance on Mac OS X: http://bugs.python.org/issue4194 | |
135 | p = subprocess.Popen(cmd, shell=True, bufsize=-1, |
|
135 | p = subprocess.Popen(cmd, shell=True, bufsize=-1, | |
136 | close_fds=closefds, |
|
136 | close_fds=closefds, | |
137 | stdin=subprocess.PIPE, stdout=subprocess.PIPE, |
|
137 | stdin=subprocess.PIPE, stdout=subprocess.PIPE, | |
138 | universal_newlines=newlines, |
|
|||
139 | env=env) |
|
138 | env=env) | |
140 | return p.stdin, p.stdout |
|
139 | return p.stdin, p.stdout | |
141 |
|
140 | |||
142 |
def popen3(cmd, env=None |
|
141 | def popen3(cmd, env=None): | |
143 |
stdin, stdout, stderr, p = popen4(cmd, env |
|
142 | stdin, stdout, stderr, p = popen4(cmd, env) | |
144 | return stdin, stdout, stderr |
|
143 | return stdin, stdout, stderr | |
145 |
|
144 | |||
146 |
def popen4(cmd, env=None, |
|
145 | def popen4(cmd, env=None, bufsize=-1): | |
147 | p = subprocess.Popen(cmd, shell=True, bufsize=bufsize, |
|
146 | p = subprocess.Popen(cmd, shell=True, bufsize=bufsize, | |
148 | close_fds=closefds, |
|
147 | close_fds=closefds, | |
149 | stdin=subprocess.PIPE, stdout=subprocess.PIPE, |
|
148 | stdin=subprocess.PIPE, stdout=subprocess.PIPE, | |
150 | stderr=subprocess.PIPE, |
|
149 | stderr=subprocess.PIPE, | |
151 | universal_newlines=newlines, |
|
|||
152 | env=env) |
|
150 | env=env) | |
153 | return p.stdin, p.stdout, p.stderr, p |
|
151 | return p.stdin, p.stdout, p.stderr, p | |
154 |
|
152 |
General Comments 0
You need to be logged in to leave comments.
Login now