diff options
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/tutorial/controlflow.rst | 3 | ||||
-rw-r--r-- | Doc/tutorial/errors.rst | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/Doc/tutorial/controlflow.rst b/Doc/tutorial/controlflow.rst index ce47164..5a182a9 100644 --- a/Doc/tutorial/controlflow.rst +++ b/Doc/tutorial/controlflow.rst @@ -329,7 +329,8 @@ defined to allow. For example:: 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' + if retries < 0: + raise IOError('refusenik user') print(complaint) This function can be called either like this: ``ask_ok('Do you really want to diff --git a/Doc/tutorial/errors.rst b/Doc/tutorial/errors.rst index 706e2c0..162457e 100644 --- a/Doc/tutorial/errors.rst +++ b/Doc/tutorial/errors.rst @@ -262,7 +262,7 @@ directly or indirectly. For example:: ... print('My exception occurred, value:', e.value) ... My exception occurred, value: 4 - >>> raise MyError, 'oops!' + >>> raise MyError('oops!') Traceback (most recent call last): File "<stdin>", line 1, in ? __main__.MyError: 'oops!' |