Commit 58721bca authored by Collin Winter's avatar Collin Winter

Fix more raise statments in the docs.

parent c7526f5b
...@@ -329,7 +329,8 @@ defined to allow. For example:: ...@@ -329,7 +329,8 @@ defined to allow. For example::
if ok in ('y', 'ye', 'yes'): return True if ok in ('y', 'ye', 'yes'): return True
if ok in ('n', 'no', 'nop', 'nope'): return False if ok in ('n', 'no', 'nop', 'nope'): return False
retries = retries - 1 retries = retries - 1
if retries < 0: raise IOError, 'refusenik user' if retries < 0:
raise IOError('refusenik user')
print(complaint) print(complaint)
This function can be called either like this: ``ask_ok('Do you really want to This function can be called either like this: ``ask_ok('Do you really want to
......
...@@ -262,7 +262,7 @@ directly or indirectly. For example:: ...@@ -262,7 +262,7 @@ directly or indirectly. For example::
... print('My exception occurred, value:', e.value) ... print('My exception occurred, value:', e.value)
... ...
My exception occurred, value: 4 My exception occurred, value: 4
>>> raise MyError, 'oops!' >>> raise MyError('oops!')
Traceback (most recent call last): Traceback (most recent call last):
File "<stdin>", line 1, in ? File "<stdin>", line 1, in ?
__main__.MyError: 'oops!' __main__.MyError: 'oops!'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment