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

Unified Diff: gclient_utils.py

Issue 503068: Make breakpad, gcl and presubmit_support dependencies optional (Closed)
Patch Set: Fix spurious error Created 11 years 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 | « gcl.py ('k') | tests/trychange_unittest.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 6ea091c12ce1624c2691a136bce0f06bf75a92ce..4944cf96744b4771402fd9c8ad33cbccbc879af5 100644
--- a/gclient_utils.py
+++ b/gclient_utils.py
@@ -35,15 +35,19 @@ class CheckCallError(OSError):
self.stdout = stdout
-def CheckCall(command, cwd=None):
+def CheckCall(command, cwd=None, print_error=True):
"""Like subprocess.check_call() but returns stdout.
Works on python 2.4
"""
try:
+ stderr = None
+ if not print_error:
+ stderr = subprocess.PIPE
process = subprocess.Popen(command, cwd=cwd,
shell=sys.platform.startswith('win'),
- stdout=subprocess.PIPE)
+ stdout=subprocess.PIPE,
+ stderr=stderr)
output = process.communicate()[0]
except OSError, e:
raise CheckCallError(command, cwd, errno, None)
« no previous file with comments | « gcl.py ('k') | tests/trychange_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698