summaryrefslogtreecommitdiffstats
path: root/Lib/packaging/create.py
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2011-09-19 14:21:37 (GMT)
committerÉric Araujo <merwok@netwok.org>2011-09-19 14:21:37 (GMT)
commit1cbd2ab4044dbef8e1c7cb0b694f30049f42e7f6 (patch)
tree9b15764cdc5a7e8ee5d3692516a5cf4c1f15b37c /Lib/packaging/create.py
parentbecf1c58572f29d4f35f448194e3ef9c535e3be0 (diff)
downloadcpython-1cbd2ab4044dbef8e1c7cb0b694f30049f42e7f6.zip
cpython-1cbd2ab4044dbef8e1c7cb0b694f30049f42e7f6.tar.gz
cpython-1cbd2ab4044dbef8e1c7cb0b694f30049f42e7f6.tar.bz2
Avoid matching '' or 'yn' when asking for 'y' or 'n' in interactive code
Diffstat (limited to 'Lib/packaging/create.py')
-rw-r--r--Lib/packaging/create.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/packaging/create.py b/Lib/packaging/create.py
index 34a8c82..59b448d 100644
--- a/Lib/packaging/create.py
+++ b/Lib/packaging/create.py
@@ -121,7 +121,7 @@ def ask_yn(question, default=None, helptext=None):
question += ' (y/n)'
while True:
answer = ask(question, default, helptext, required=True)
- if answer and answer[0].lower() in 'yn':
+ if answer and answer[0].lower() in ('y', 'n'):
return answer[0].lower()
print('\nERROR: You must select "Y" or "N".\n')