Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Unified Diff: subprocess2.py

Issue 6693078: Add subprocess2 unit tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/subprocess2_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: subprocess2.py
diff --git a/subprocess2.py b/subprocess2.py
index c9057ac6ae19dd32c996b6c333bd5cc071a21d84..f4a9a2f3983c73780336781fa0fb4c4c4d2a5e9a 100644
--- a/subprocess2.py
+++ b/subprocess2.py
@@ -233,9 +233,11 @@ def capture(args, **kwargs):
- Discards returncode.
- Discards stderr. By default sets stderr=STDOUT.
"""
+ if kwargs.get('stdout') is None:
+ kwargs['stdout'] = PIPE
if kwargs.get('stderr') is None:
kwargs['stderr'] = STDOUT
- return call(args, stdout=PIPE, **kwargs)[0][0]
+ return call(args, **kwargs)[0][0]
def check_output(args, **kwargs):
@@ -247,6 +249,8 @@ def check_output(args, **kwargs):
- Throws if return code is not 0.
- Works even prior to python 2.7.
"""
+ if kwargs.get('stdout') is None:
+ kwargs['stdout'] = PIPE
if kwargs.get('stderr') is None:
kwargs['stderr'] = STDOUT
- return check_call(args, stdout=PIPE, **kwargs)[0]
+ return check_call(args, **kwargs)[0]
« no previous file with comments | « no previous file | tests/subprocess2_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698