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

Unified Diff: lib/cros_build_lib.py

Issue 6902129: Arbitrarily large output can't be used in an exception. (Closed) Base URL: http://git.chromium.org/git/crosutils.git@master
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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/cros_build_lib.py
diff --git a/lib/cros_build_lib.py b/lib/cros_build_lib.py
index 804e915aa62c7cfe058f12c532ee4a928cd77ec7..5a1c0d2e770cad45343e86c8549a2deb2bde559e 100644
--- a/lib/cros_build_lib.py
+++ b/lib/cros_build_lib.py
@@ -110,8 +110,12 @@ def RunCommand(cmd, print_cmd=True, error_ok=False, error_message=None,
# If the command (and all retries) failed, handle error result
if proc.returncode != 0 and not error_ok:
+ if output:
+ print >> sys.stderr, output
+ sys.stderr.flush()
+
error_info = ('Command "%r" failed.\n' % (cmd) +
- (error_message or error or output or ''))
+ (error_message or error or ''))
if log_to_file: error_info += '\nOutput logged to %s' % log_to_file
raise RunCommandException(error_info)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698