From 79f14744774bbb97946c0cddedb46c390702c432 Mon Sep 17 00:00:00 2001 From: "evan@chromium.org" Date: Wed, 10 Mar 2010 01:01:57 +0000 Subject: build-bisect: don't crash on bad input to the good/bad prompt Review URL: http://codereview.chromium.org/786001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41105 0039d316-1c4b-4281-b951-d872f2087c98 --- build/build-bisect.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'build/build-bisect.py') diff --git a/build/build-bisect.py b/build/build-bisect.py index aeec7b3..1c6b416 100755 --- a/build/build-bisect.py +++ b/build/build-bisect.py @@ -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' -- cgit v1.1