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

Unified Diff: gclient_utils.py

Issue 3737001: Fix a bug in gclient recurse for git-svn users. Make gclient_utils.CheckCall more versatile. (Closed)
Patch Set: Created 10 years, 2 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 | « gclient.py ('k') | tests/gclient_utils_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient_utils.py
diff --git a/gclient_utils.py b/gclient_utils.py
index 3c374d5a3d5726c0dca6c0cba2af3b2801f6c5fb..743e57bc163ed7dfb751686e5687d8f64ebbfc29 100644
--- a/gclient_utils.py
+++ b/gclient_utils.py
@@ -84,7 +84,7 @@ def Popen(args, **kwargs):
raise
-def CheckCall(command, cwd=None, print_error=True):
+def CheckCall(command, print_error=True, **kwargs):
"""Similar subprocess.check_call() but redirects stdout and
returns (stdout, stderr).
@@ -94,12 +94,13 @@ def CheckCall(command, cwd=None, print_error=True):
stderr = None
if not print_error:
stderr = subprocess.PIPE
- process = Popen(command, cwd=cwd, stdout=subprocess.PIPE, stderr=stderr)
+ process = Popen(command, stdout=subprocess.PIPE, stderr=stderr, **kwargs)
std_out, std_err = process.communicate()
except OSError, e:
- raise CheckCallError(command, cwd, e.errno, None)
+ raise CheckCallError(command, kwargs.get('cwd', None), e.errno, None)
if process.returncode:
- raise CheckCallError(command, cwd, process.returncode, std_out, std_err)
+ raise CheckCallError(command, kwargs.get('cwd', None), process.returncode,
+ std_out, std_err)
return std_out, std_err
« no previous file with comments | « gclient.py ('k') | tests/gclient_utils_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698