build-bisect: don't crash on bad input to the good/bad prompt

Review URL: http://codereview.chromium.org/786001

git-svn-id: http://src.chromium.org/svn/trunk/src/build@41105 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This commit is contained in:
evan@chromium.org 2010-03-10 01:01:57 +00:00
Родитель d33a3a7dc3
Коммит 1c7d7aba85
1 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -135,14 +135,14 @@ def TryRevision(rev, profile, args):
except Exception, e:
pass
def AskIsGoodBuild(rev):
"""Annoyingly ask the user whether build |rev| is good or bad."""
"""Ask the user whether build |rev| is good or bad."""
# Loop until we get a response that we can parse.
while True:
check = raw_input("\nBuild %d is [(g)ood/(b)ad]: " % int(rev))[0]
if (check == "g" or check == "b"):
return (check == "g")
else:
print("Just answer the question...")
response = raw_input("\nBuild %d is [(g)ood/(b)ad]: " % int(rev))
if response and response in ("g", "b"):
return response == "g"
def main():
usage = ('%prog [options] [-- chromium-options]\n'