From 76f2ff3197c9c93b7bbdf0d38b8d67aa70a49ef0 Mon Sep 17 00:00:00 2001 From: "ahe@google.com" Date: Fri, 5 Apr 2013 18:15:39 +0000 Subject: [PATCH] Catch CalledProcessError which is throw if the command has non-zero exit code. Review URL: https://codereview.chromium.org//13674014 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20992 260f80e4-7a28-3924-810f-c04153c831b5 --- tools/build.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/build.py b/tools/build.py index f7ad04575bb..886749f6ef7 100755 --- a/tools/build.py +++ b/tools/build.py @@ -266,9 +266,13 @@ PhaseScriptExecution "Action \"upload_sdk_py\"" xcodebuild/dart.build/... term = os.getenv('TERM', 'dumb') # The capability "clr_eol" means clear the line from cursor to end # of line. See man pages for tput and terminfo. - clr_eol = subprocess.check_output(['tput', '-T' + term, 'el']) - if clr_eol: - is_fancy_tty = True + try: + clr_eol = subprocess.check_output(['tput', '-T' + term, 'el'], + stderr=subprocess.STDOUT) + if clr_eol: + is_fancy_tty = True + except subprocess.CalledProcessError: + is_fancy_tty = False for line in unbuffered(process.stdout.readline): line = line.rstrip() if line.startswith('=== BUILD ') or line.startswith('** BUILD '):