summaryrefslogtreecommitdiffstats
path: root/Doc/includes
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-06-03 07:25:35 (GMT)
committerGeorg Brandl <georg@python.org>2009-06-03 07:25:35 (GMT)
commitc1edec3374bb03ca936be3cd0b968140ec58e819 (patch)
tree4160a66a97eab66e3cc6d533566e8368a9cc9b8f /Doc/includes
parentdad7b7b1cb83d6ead5e8af5c747256a1aaa3f6cf (diff)
downloadcpython-c1edec3374bb03ca936be3cd0b968140ec58e819.zip
cpython-c1edec3374bb03ca936be3cd0b968140ec58e819.tar.gz
cpython-c1edec3374bb03ca936be3cd0b968140ec58e819.tar.bz2
Use the preferred form of raise statements in the docs.
Diffstat (limited to 'Doc/includes')
-rw-r--r--Doc/includes/email-unpack.py2
-rw-r--r--Doc/includes/mp_pool.py8
-rw-r--r--Doc/includes/mp_synchronize.py4
3 files changed, 7 insertions, 7 deletions
diff --git a/Doc/includes/email-unpack.py b/Doc/includes/email-unpack.py
index daf2470..8f99ded 100644
--- a/Doc/includes/email-unpack.py
+++ b/Doc/includes/email-unpack.py
@@ -37,7 +37,7 @@ Usage: %prog [options] msgfile
os.mkdir(opts.directory)
except OSError, e:
# Ignore directory exists error
- if e.errno <> errno.EEXIST:
+ if e.errno != errno.EEXIST:
raise
fp = open(msgfile)
diff --git a/Doc/includes/mp_pool.py b/Doc/includes/mp_pool.py
index 9e89cbc..0a3d92a 100644
--- a/Doc/includes/mp_pool.py
+++ b/Doc/includes/mp_pool.py
@@ -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()'
diff --git a/Doc/includes/mp_synchronize.py b/Doc/includes/mp_synchronize.py
index 2f43ad8..fd2ae77 100644
--- a/Doc/includes/mp_synchronize.py
+++ b/Doc/includes/mp_synchronize.py
@@ -249,7 +249,7 @@ def test(namespace=multiprocessing):
info = multiprocessing._debug_info()
if info:
print info
- raise ValueError, 'there should be no positive refcounts left'
+ raise ValueError('there should be no positive refcounts left')
if __name__ == '__main__':
@@ -271,6 +271,6 @@ if __name__ == '__main__':
import multiprocessing.dummy as namespace
else:
print 'Usage:\n\t%s [processes | manager | threads]' % sys.argv[0]
- raise SystemExit, 2
+ raise SystemExit(2)
test(namespace)