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

Skip to content

Commit 58721bc

Browse files
committed
Fix more raise statments in the docs.
1 parent c7526f5 commit 58721bc

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

Doc/tutorial/controlflow.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,8 @@ defined to allow. For example::
329329
if ok in ('y', 'ye', 'yes'): return True
330330
if ok in ('n', 'no', 'nop', 'nope'): return False
331331
retries = retries - 1
332-
if retries < 0: raise IOError, 'refusenik user'
332+
if retries < 0:
333+
raise IOError('refusenik user')
333334
print(complaint)
334335

335336
This function can be called either like this: ``ask_ok('Do you really want to

Doc/tutorial/errors.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ directly or indirectly. For example::
262262
... print('My exception occurred, value:', e.value)
263263
...
264264
My exception occurred, value: 4
265-
>>> raise MyError, 'oops!'
265+
>>> raise MyError('oops!')
266266
Traceback (most recent call last):
267267
File "<stdin>", line 1, in ?
268268
__main__.MyError: 'oops!'

0 commit comments

Comments
 (0)