Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
016d8235
Commit
016d8235
authored
Sep 19, 2011
by
Éric Araujo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid matching '' or 'yn' when asking for 'y' or 'n' in interactive code
parent
13f5bb73
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
Lib/packaging/command/register.py
Lib/packaging/command/register.py
+1
-1
Lib/packaging/create.py
Lib/packaging/create.py
+1
-1
No files found.
Lib/packaging/command/register.py
View file @
016d8235
...
...
@@ -178,7 +178,7 @@ Your selection [default 1]: ''')
'will be faster.
\
n
(the login will be stored in %s)'
,
get_pypirc_path
())
choice
=
'X'
while
choice
.
lower
()
not
in
'yn'
:
while
choice
.
lower
()
not
in
(
'y'
,
'n'
)
:
choice
=
input
(
'Save your login (y/N)?'
)
if
not
choice
:
choice
=
'n'
...
...
Lib/packaging/create.py
View file @
016d8235
...
...
@@ -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
(
'
\
n
ERROR: You must select "Y" or "N".
\
n
'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment