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

Unified Diff: subprocess2.py

Issue 6823091: Defaults stdin to VOID for capture and check_output() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 8 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 b22d3e1ab5fea52511c5b607725adfc4c0364fee..3cc79aeb899bcfa1650c79db36d459c2c71ff9db 100644
--- a/subprocess2.py
+++ b/subprocess2.py
@@ -259,7 +259,10 @@ def capture(args, **kwargs):
- Discards returncode.
- Discards stderr. By default sets stderr=STDOUT.
+ - Blocks stdin by default since no output will be visible.
"""
+ if kwargs.get('stdin') is None:
+ kwargs['stdin'] = VOID
if kwargs.get('stdout') is None:
kwargs['stdout'] = PIPE
if kwargs.get('stderr') is None:
@@ -275,7 +278,10 @@ def check_output(args, **kwargs):
- Discards stderr. By default sets stderr=STDOUT.
- Throws if return code is not 0.
- Works even prior to python 2.7.
+ - Blocks stdin by default since no output will be visible.
"""
+ if kwargs.get('stdin') is None:
+ kwargs['stdin'] = VOID
if kwargs.get('stdout') is None:
kwargs['stdout'] = PIPE
if kwargs.get('stderr') is None:
« 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