]> granicus.if.org Git - python/commitdiff
Fix more raise statments in the docs.
authorCollin Winter <collinw@gmail.com>
Mon, 10 Sep 2007 00:39:52 +0000 (00:39 +0000)
committerCollin Winter <collinw@gmail.com>
Mon, 10 Sep 2007 00:39:52 +0000 (00:39 +0000)
Doc/tutorial/controlflow.rst
Doc/tutorial/errors.rst

index ce47164300cfc0b17c96fb53e6d77a2f4fd38223..5a182a91a7854374e5c45df11880f2ebacb07d56 100644 (file)
@@ -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
index 706e2c0ddffc9c05b6ccc501a0fcf50f0fc769a7..162457edec1233430b0462e094476d58b3e4e972 100644 (file)
@@ -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!'