Use the preferred form of raise statements in the docs.

This commit is contained in:
Georg Brandl 2009-06-03 07:25:35 +00:00
parent dad7b7b1cb
commit c1edec3374
12 changed files with 26 additions and 27 deletions

View file

@ -149,21 +149,21 @@ def test():
except ZeroDivisionError:
print '\tGot ZeroDivisionError as expected from pool.apply()'
else:
raise AssertionError, 'expected ZeroDivisionError'
raise AssertionError('expected ZeroDivisionError')
try:
print pool.map(f, range(10))
except ZeroDivisionError:
print '\tGot ZeroDivisionError as expected from pool.map()'
else:
raise AssertionError, 'expected ZeroDivisionError'
raise AssertionError('expected ZeroDivisionError')
try:
print list(pool.imap(f, range(10)))
except ZeroDivisionError:
print '\tGot ZeroDivisionError as expected from list(pool.imap())'
else:
raise AssertionError, 'expected ZeroDivisionError'
raise AssertionError('expected ZeroDivisionError')
it = pool.imap(f, range(10))
for i in range(10):
@ -176,7 +176,7 @@ def test():
break
else:
if i == 5:
raise AssertionError, 'expected ZeroDivisionError'
raise AssertionError('expected ZeroDivisionError')
assert i == 9
print '\tGot ZeroDivisionError as expected from IMapIterator.next()'