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

Skip to content

Commit 596d99a

Browse files
committed
Fix more two-arg raise statements.
1 parent bbc9712 commit 596d99a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Doc/tutorial/errors.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ Raising Exceptions
216216
The :keyword:`raise` statement allows the programmer to force a specified
217217
exception to occur. For example::
218218

219-
>>> raise NameError, 'HiThere'
219+
>>> raise NameError('HiThere')
220220
Traceback (most recent call last):
221221
File "<stdin>", line 1, in ?
222222
NameError: HiThere
@@ -231,7 +231,7 @@ handle it, a simpler form of the :keyword:`raise` statement allows you to
231231
re-raise the exception::
232232

233233
>>> try:
234-
... raise NameError, 'HiThere'
234+
... raise NameError('HiThere')
235235
... except NameError:
236236
... print('An exception flew by!')
237237
... raise

0 commit comments

Comments
 (0)