mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
Convert a 0/1 to False/True.
This commit is contained in:
parent
1d7323e4e7
commit
25695282a5
1 changed files with 2 additions and 2 deletions
|
|
@ -1420,8 +1420,8 @@ arguments than it is defined
|
|||
def ask_ok(prompt, retries=4, complaint='Yes or no, please!'):
|
||||
while True:
|
||||
ok = raw_input(prompt)
|
||||
if ok in ('y', 'ye', 'yes'): return 1
|
||||
if ok in ('n', 'no', 'nop', 'nope'): return 0
|
||||
if ok in ('y', 'ye', 'yes'): return True
|
||||
if ok in ('n', 'no', 'nop', 'nope'): return False
|
||||
retries = retries - 1
|
||||
if retries < 0: raise IOError, 'refusenik user'
|
||||
print complaint
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue