mirror of
https://github.com/python/cpython.git
synced 2025-10-25 07:48:51 +00:00
Use Boolean values for the capturestderr flag.
This commit is contained in:
parent
70fedcd583
commit
b5aa407196
1 changed files with 3 additions and 3 deletions
|
|
@ -25,7 +25,7 @@ class Popen3:
|
||||||
|
|
||||||
sts = -1 # Child not completed yet
|
sts = -1 # Child not completed yet
|
||||||
|
|
||||||
def __init__(self, cmd, capturestderr=0, bufsize=-1):
|
def __init__(self, cmd, capturestderr=False, bufsize=-1):
|
||||||
"""The parameter 'cmd' is the shell command to execute in a
|
"""The parameter 'cmd' is the shell command to execute in a
|
||||||
sub-process. The 'capturestderr' flag, if true, specifies that
|
sub-process. The 'capturestderr' flag, if true, specifies that
|
||||||
the object should capture standard error output of the child process.
|
the object should capture standard error output of the child process.
|
||||||
|
|
@ -141,14 +141,14 @@ else:
|
||||||
"""Execute the shell command 'cmd' in a sub-process. If 'bufsize' is
|
"""Execute the shell command 'cmd' in a sub-process. If 'bufsize' is
|
||||||
specified, it sets the buffer size for the I/O pipes. The file objects
|
specified, it sets the buffer size for the I/O pipes. The file objects
|
||||||
(child_stdout, child_stdin) are returned."""
|
(child_stdout, child_stdin) are returned."""
|
||||||
inst = Popen3(cmd, 0, bufsize)
|
inst = Popen3(cmd, False, bufsize)
|
||||||
return inst.fromchild, inst.tochild
|
return inst.fromchild, inst.tochild
|
||||||
|
|
||||||
def popen3(cmd, bufsize=-1, mode='t'):
|
def popen3(cmd, bufsize=-1, mode='t'):
|
||||||
"""Execute the shell command 'cmd' in a sub-process. If 'bufsize' is
|
"""Execute the shell command 'cmd' in a sub-process. If 'bufsize' is
|
||||||
specified, it sets the buffer size for the I/O pipes. The file objects
|
specified, it sets the buffer size for the I/O pipes. The file objects
|
||||||
(child_stdout, child_stdin, child_stderr) are returned."""
|
(child_stdout, child_stdin, child_stderr) are returned."""
|
||||||
inst = Popen3(cmd, 1, bufsize)
|
inst = Popen3(cmd, True, bufsize)
|
||||||
return inst.fromchild, inst.tochild, inst.childerr
|
return inst.fromchild, inst.tochild, inst.childerr
|
||||||
|
|
||||||
def popen4(cmd, bufsize=-1, mode='t'):
|
def popen4(cmd, bufsize=-1, mode='t'):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue