Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
02e7dfde
Commit
02e7dfde
authored
Dec 28, 2009
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#7381: consistency update, and backport avoiding ``None >= 0`` check from py3k.
parent
fe8df4fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
Lib/subprocess.py
Lib/subprocess.py
+6
-4
No files found.
Lib/subprocess.py
View file @
02e7dfde
...
...
@@ -136,7 +136,8 @@ check_output(*popenargs, **kwargs):
The arguments are the same as for the Popen constructor. Example:
output = subprocess.check_output(["ls", "-l", "/dev/null"])
output = check_output(["ls", "-l", "/dev/null"])
Exceptions
----------
...
...
@@ -462,7 +463,8 @@ _active = []
def
_cleanup
():
for
inst
in
_active
[:]:
if
inst
.
_internal_poll
(
_deadstate
=
sys
.
maxint
)
>=
0
:
res
=
inst
.
_internal_poll
(
_deadstate
=
sys
.
maxint
)
if
res
is
not
None
and
res
>=
0
:
try
:
_active
.
remove
(
inst
)
except
ValueError
:
...
...
@@ -517,11 +519,11 @@ def check_output(*popenargs, **kwargs):
'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n'
The stdout argument is not allowed as it is used internally.
To capture standard error in the result, use stderr=
subprocess.
STDOUT.
To capture standard error in the result, use stderr=STDOUT.
>>> check_output(["/bin/sh", "-c",
... "ls -l non_existent_file ; exit 0"],
... stderr=
subprocess.
STDOUT)
... stderr=STDOUT)
'ls: non_existent_file: No such file or directory\n'
"""
if
'stdout'
in
kwargs
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment