Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9c27c18

Browse files
committed
Issue #23116: Merge from 3.5
2 parents 9cd39a1 + 0a5120e commit 9c27c18

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Doc/tutorial/controlflow.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ The most useful form is to specify a default value for one or more arguments.
364364
This creates a function that can be called with fewer arguments than it is
365365
defined to allow. For example::
366366

367-
def ask_ok(prompt, retries=4, complaint='Yes or no, please!'):
367+
def ask_ok(prompt, retries=4, reminder='Please try again!'):
368368
while True:
369369
ok = input(prompt)
370370
if ok in ('y', 'ye', 'yes'):
@@ -373,8 +373,8 @@ defined to allow. For example::
373373
return False
374374
retries = retries - 1
375375
if retries < 0:
376-
raise OSError('uncooperative user')
377-
print(complaint)
376+
raise ValueError('invalid user response')
377+
print(reminder)
378378

379379
This function can be called in several ways:
380380

0 commit comments

Comments
 (0)