Convert prompt answers to lower case before checking
When prompting for yes/no answers, convert the answer to lower
case before comparing. This makes it easier to catch answers
like "Yes", "yes", and "YES" with a comparison only for "yes".
Change-Id: I06da8281cec81a7438ebb46ddaf3344d12abe1eb
diff --git a/subcmds/upload.py b/subcmds/upload.py
index 39721ac..925652c 100644
--- a/subcmds/upload.py
+++ b/subcmds/upload.py
@@ -186,8 +186,8 @@
print ' %s' % commit
sys.stdout.write('to %s (y/N)? ' % remote.review)
- answer = sys.stdin.readline().strip()
- answer = answer in ('y', 'Y', 'yes', '1', 'true', 't')
+ answer = sys.stdin.readline().strip().lower()
+ answer = answer in ('y', 'yes', '1', 'true', 't')
if answer:
if len(branch.commits) > UNUSUAL_COMMIT_THRESHOLD: