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
This commit is contained in:
ahe@google.com 2013-04-05 18:15:39 +00:00
parent 6d1d524511
commit 76f2ff3197

View file

@ -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 '):