Use the preferred form of raise statements in the docs.
diff --git a/Doc/howto/sockets.rst b/Doc/howto/sockets.rst
index 3cba020..1928c2a 100644
--- a/Doc/howto/sockets.rst
+++ b/Doc/howto/sockets.rst
@@ -204,8 +204,7 @@
            while totalsent < MSGLEN:
                sent = self.sock.send(msg[totalsent:])
                if sent == 0:
-                   raise RuntimeError, \
-                       "socket connection broken"
+                   raise RuntimeError("socket connection broken")
                totalsent = totalsent + sent
 
        def myreceive(self):
@@ -213,8 +212,7 @@
            while len(msg) < MSGLEN:
                chunk = self.sock.recv(MSGLEN-len(msg))
                if chunk == '':
-                   raise RuntimeError, \
-                       "socket connection broken"
+                   raise RuntimeError("socket connection broken")
                msg = msg + chunk
            return msg
 
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 @@
         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 @@
     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 @@
             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 @@
         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 @@
         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)
diff --git a/Doc/library/crypt.rst b/Doc/library/crypt.rst
index 2f037c7..91464ef 100644
--- a/Doc/library/crypt.rst
+++ b/Doc/library/crypt.rst
@@ -52,7 +52,8 @@
        cryptedpasswd = pwd.getpwnam(username)[1]
        if cryptedpasswd:
            if cryptedpasswd == 'x' or cryptedpasswd == '*':
-               raise "Sorry, currently no support for shadow passwords"
+               raise NotImplementedError(
+                   "Sorry, currently no support for shadow passwords")
            cleartext = getpass.getpass()
            return crypt.crypt(cleartext, cryptedpasswd) == cryptedpasswd
        else:
diff --git a/Doc/library/imputil.rst b/Doc/library/imputil.rst
index 09a41f6..86089d2 100644
--- a/Doc/library/imputil.rst
+++ b/Doc/library/imputil.rst
@@ -160,7 +160,7 @@
            parent = None
            q = import_module(head, qname, parent)
            if q: return q, tail
-       raise ImportError, "No module named " + qname
+       raise ImportError("No module named " + qname)
 
    def load_tail(q, tail):
        m = q
@@ -171,7 +171,7 @@
            mname = "%s.%s" % (m.__name__, head)
            m = import_module(head, mname, m)
            if not m:
-               raise ImportError, "No module named " + mname
+               raise ImportError("No module named " + mname)
        return m
 
    def ensure_fromlist(m, fromlist, recursive=0):
@@ -189,7 +189,7 @@
                subname = "%s.%s" % (m.__name__, sub)
                submod = import_module(sub, subname, m)
                if not submod:
-                   raise ImportError, "No module named " + subname
+                   raise ImportError("No module named " + subname)
 
    def import_module(partname, fqname, parent):
        try:
diff --git a/Doc/library/rexec.rst b/Doc/library/rexec.rst
index 7736904..2ce612a 100644
--- a/Doc/library/rexec.rst
+++ b/Doc/library/rexec.rst
@@ -272,11 +272,11 @@
            elif mode in ('w', 'wb', 'a', 'ab'):
                # check filename : must begin with /tmp/
                if file[:5]!='/tmp/':
-                   raise IOError, "can't write outside /tmp"
+                   raise IOError("can't write outside /tmp")
                elif (string.find(file, '/../') >= 0 or
                     file[:3] == '../' or file[-3:] == '/..'):
-                   raise IOError, "'..' in filename forbidden"
-           else: raise IOError, "Illegal open() mode"
+                   raise IOError("'..' in filename forbidden")
+           else: raise IOError("Illegal open() mode")
            return open(file, mode, buf)
 
 Notice that the above code will occasionally forbid a perfectly valid filename;
diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst
index e09b646..ad3ab57 100644
--- a/Doc/library/shutil.rst
+++ b/Doc/library/shutil.rst
@@ -216,7 +216,7 @@
        except OSError, why:
            errors.extend((src, dst, str(why)))
        if errors:
-           raise Error, errors
+           raise Error(errors)
 
 Another example that uses the :func:`ignore_patterns` helper::
 
diff --git a/Doc/library/signal.rst b/Doc/library/signal.rst
index 3793a89..c039eee 100644
--- a/Doc/library/signal.rst
+++ b/Doc/library/signal.rst
@@ -232,7 +232,7 @@
 
    def handler(signum, frame):
        print 'Signal handler called with signal', signum
-       raise IOError, "Couldn't open device!"
+       raise IOError("Couldn't open device!")
 
    # Set the signal handler and a 5-second alarm
    signal.signal(signal.SIGALRM, handler)
diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst
index e295552..6f0f1f1 100644
--- a/Doc/reference/simple_stmts.rst
+++ b/Doc/reference/simple_stmts.rst
@@ -288,7 +288,7 @@
 The extended form, ``assert expression1, expression2``, is equivalent to ::
 
    if __debug__:
-      if not expression1: raise AssertionError, expression2
+      if not expression1: raise AssertionError(expression2)
 
 .. index::
    single: __debug__
diff --git a/Doc/tools/roman.py b/Doc/tools/roman.py
index 33f6db7..89ef617 100644
--- a/Doc/tools/roman.py
+++ b/Doc/tools/roman.py
@@ -40,9 +40,9 @@
 def toRoman(n):
     """convert integer to Roman numeral"""
     if not (0 < n < 5000):
-        raise OutOfRangeError, "number out of range (must be 1..4999)"
-    if int(n) <> n:
-        raise NotIntegerError, "decimals can not be converted"
+        raise OutOfRangeError("number out of range (must be 1..4999)")
+    if int(n) != n:
+        raise NotIntegerError("decimals can not be converted")
 
     result = ""
     for numeral, integer in romanNumeralMap:
@@ -67,9 +67,9 @@
 def fromRoman(s):
     """convert Roman numeral to integer"""
     if not s:
-        raise InvalidRomanNumeralError, 'Input can not be blank'
+        raise InvalidRomanNumeralError('Input can not be blank')
     if not romanNumeralPattern.search(s):
-        raise InvalidRomanNumeralError, 'Invalid Roman numeral: %s' % s
+        raise InvalidRomanNumeralError('Invalid Roman numeral: %s' % s)
 
     result = 0
     index = 0
diff --git a/Doc/tools/sphinxext/suspicious.py b/Doc/tools/sphinxext/suspicious.py
index ae11793..37829c3 100644
--- a/Doc/tools/sphinxext/suspicious.py
+++ b/Doc/tools/sphinxext/suspicious.py
@@ -159,7 +159,7 @@
         except IOError: return
         for i, row in enumerate(csv.reader(f)):
             if len(row) != 4:
-                raise ValueError, "wrong format in %s, line %d: %s" % (filename, i+1, row)
+                raise ValueError("wrong format in %s, line %d: %s" % (filename, i+1, row))
             docname, lineno, issue, text = row
             docname = docname.decode('utf-8')
             if lineno: lineno = int(lineno)