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

Unified Diff: build/build-bisect.py

Issue 786001: build-bisect: don't crash on bad input to the good/bad prompt (Closed)
Patch Set: Created 10 years, 9 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: build/build-bisect.py
diff --git a/build/build-bisect.py b/build/build-bisect.py
index aeec7b306336bca0e0c8c037111aa12b98a6219a..1c6b41614e9514db5977d76cd34d12b67d7dfe6a 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'
« 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