From fc241240d828d7e8302dc0876608a9d27ae1cbc7 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Wed, 14 Nov 2012 09:19:39 +0900 Subject: 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 --- subcmds/init.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'subcmds/init.py') diff --git a/subcmds/init.py b/subcmds/init.py index 48df9e89..99007d60 100644 --- a/subcmds/init.py +++ b/subcmds/init.py @@ -248,7 +248,7 @@ to update the working directory files. print '' print 'Your identity is: %s <%s>' % (name, email) sys.stdout.write('is this correct [y/N]? ') - a = sys.stdin.readline().strip() + a = sys.stdin.readline().strip().lower() if a in ('yes', 'y', 't', 'true'): break -- cgit v1.2.3-54-g00ecf