[docs] [issue16714] Raise exceptions, don't throw

Serhiy Storchaka report at bugs.python.org
Tue Dec 18 20:02:47 CET 2012


Serhiy Storchaka added the comment:

Indeed. Here are updated patches.

----------
Added file: http://bugs.python.org/file28350/raise-2.7_2.patch
Added file: http://bugs.python.org/file28351/raise-3.3_2.patch
Added file: http://bugs.python.org/file28352/raise-3.2_2.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16714>
_______________________________________
-------------- next part --------------
diff -r b0935ef48186 Doc/howto/cporting.rst
--- a/Doc/howto/cporting.rst	Sun Dec 16 13:55:47 2012 +0100
+++ b/Doc/howto/cporting.rst	Tue Dec 18 20:06:01 2012 +0200
@@ -253,7 +253,7 @@
 
   * :c:func:`PyCapsule_GetName` always returns NULL.
 
-  * :c:func:`PyCapsule_SetName` always throws an exception and
+  * :c:func:`PyCapsule_SetName` always raises an exception and
     returns failure.  (Since there's no way to store a name
     in a CObject, noisy failure of :c:func:`PyCapsule_SetName`
     was deemed preferable to silent failure here.  If this is
diff -r b0935ef48186 Lib/asyncore.py
--- a/Lib/asyncore.py	Sun Dec 16 13:55:47 2012 +0100
+++ b/Lib/asyncore.py	Tue Dec 18 20:06:01 2012 +0200
@@ -393,7 +393,7 @@
             else:
                 return data
         except socket.error, why:
-            # winsock sometimes throws ENOTCONN
+            # winsock sometimes raises ENOTCONN
             if why.args[0] in _DISCONNECTED:
                 self.handle_close()
                 return ''
diff -r b0935ef48186 Lib/distutils/tests/test_msvc9compiler.py
--- a/Lib/distutils/tests/test_msvc9compiler.py	Sun Dec 16 13:55:47 2012 +0100
+++ b/Lib/distutils/tests/test_msvc9compiler.py	Tue Dec 18 20:06:01 2012 +0200
@@ -104,7 +104,7 @@
                             unittest.TestCase):
 
     def test_no_compiler(self):
-        # makes sure query_vcvarsall throws
+        # makes sure query_vcvarsall raises
         # a DistutilsPlatformError if the compiler
         # is not found
         from distutils.msvc9compiler import query_vcvarsall
diff -r b0935ef48186 Lib/email/feedparser.py
--- a/Lib/email/feedparser.py	Sun Dec 16 13:55:47 2012 +0100
+++ b/Lib/email/feedparser.py	Tue Dec 18 20:06:01 2012 +0200
@@ -13,7 +13,7 @@
 data.  When you have no more data to push into the parser, call .close().
 This completes the parsing and returns the root message object.
 
-The other advantage of this parser is that it will never throw a parsing
+The other advantage of this parser is that it will never raise a parsing
 exception.  Instead, when it finds something unexpected, it adds a 'defect' to
 the current message.  Defects are just instances that live on the message
 object's .defects attribute.
@@ -214,7 +214,7 @@
         # supposed to see in the body of the message.
         self._parse_headers(headers)
         # Headers-only parsing is a backwards compatibility hack, which was
-        # necessary in the older parser, which could throw errors.  All
+        # necessary in the older parser, which could raise errors.  All
         # remaining lines in the input are thrown into the message body.
         if self._headersonly:
             lines = []
diff -r b0935ef48186 Lib/email/header.py
--- a/Lib/email/header.py	Sun Dec 16 13:55:47 2012 +0100
+++ b/Lib/email/header.py	Tue Dec 18 20:06:01 2012 +0200
@@ -103,7 +103,7 @@
                         dec = email.base64mime.decode(encoded)
                     except binascii.Error:
                         # Turn this into a higher level exception.  BAW: Right
-                        # now we throw the lower level exception away but
+                        # now we raise the lower level exception away but
                         # when/if we get exception chaining, we'll preserve it.
                         raise HeaderParseError
                 if dec is None:
diff -r b0935ef48186 Lib/httplib.py
--- a/Lib/httplib.py	Sun Dec 16 13:55:47 2012 +0100
+++ b/Lib/httplib.py	Tue Dec 18 20:06:01 2012 +0200
@@ -1068,7 +1068,7 @@
         if port == 0:
             port = None
 
-        # Note that we may pass an empty string as the host; this will throw
+        # Note that we may pass an empty string as the host; this will raise
         # an error when we attempt to connect. Presumably, the client code
         # will call connect before then, with a proper host.
         self._setup(self._connection_class(host, port, strict))
diff -r b0935ef48186 Lib/io.py
--- a/Lib/io.py	Sun Dec 16 13:55:47 2012 +0100
+++ b/Lib/io.py	Tue Dec 18 20:06:01 2012 +0200
@@ -4,7 +4,7 @@
 At the top of the I/O hierarchy is the abstract base class IOBase. It
 defines the basic interface to a stream. Note, however, that there is no
 separation between reading and writing to streams; implementations are
-allowed to throw an IOError if they do not support a given operation.
+allowed to raise an IOError if they do not support a given operation.
 
 Extending IOBase is RawIOBase which deals simply with the reading and
 writing of raw bytes to a stream. FileIO subclasses RawIOBase to provide
diff -r b0935ef48186 Lib/lib-tk/Tkinter.py
--- a/Lib/lib-tk/Tkinter.py	Sun Dec 16 13:55:47 2012 +0100
+++ b/Lib/lib-tk/Tkinter.py	Tue Dec 18 20:06:01 2012 +0200
@@ -155,7 +155,7 @@
     pass
 
 def _exit(code=0):
-    """Internal function. Calling it will throw the exception SystemExit."""
+    """Internal function. Calling it will raise the exception SystemExit."""
     try:
         code = int(code)
     except ValueError:
diff -r b0935ef48186 Lib/logging/__init__.py
--- a/Lib/logging/__init__.py	Sun Dec 16 13:55:47 2012 +0100
+++ b/Lib/logging/__init__.py	Tue Dec 18 20:06:01 2012 +0200
@@ -1251,7 +1251,7 @@
         all the handlers of this logger to handle the record.
         """
         if _srcfile:
-            #IronPython doesn't track Python frames, so findCaller throws an
+            #IronPython doesn't track Python frames, so findCaller raises an
             #exception on some versions of IronPython. We trap it here so that
             #IronPython can use logging.
             try:
diff -r b0935ef48186 Lib/runpy.py
--- a/Lib/runpy.py	Sun Dec 16 13:55:47 2012 +0100
+++ b/Lib/runpy.py	Tue Dec 18 20:06:01 2012 +0200
@@ -200,7 +200,7 @@
                 pass
         else:
             # The following check looks a bit odd. The trick is that
-            # NullImporter throws ImportError if the supplied path is a
+            # NullImporter raises ImportError if the supplied path is a
             # *valid* directory entry (and hence able to be handled
             # by the standard import machinery)
             try:
diff -r b0935ef48186 Lib/test/test_codeop.py
--- a/Lib/test/test_codeop.py	Sun Dec 16 13:55:47 2012 +0100
+++ b/Lib/test/test_codeop.py	Tue Dec 18 20:06:01 2012 +0200
@@ -50,7 +50,7 @@
         '''succeed iff str is the start of an invalid piece of code'''
         try:
             compile_command(str,symbol=symbol)
-            self.fail("No exception thrown for invalid code")
+            self.fail("No exception raised for invalid code")
         except SyntaxError:
             self.assertTrue(is_syntax)
         except OverflowError:
diff -r b0935ef48186 Lib/test/test_docxmlrpc.py
--- a/Lib/test/test_docxmlrpc.py	Sun Dec 16 13:55:47 2012 +0100
+++ b/Lib/test/test_docxmlrpc.py	Tue Dec 18 20:06:01 2012 +0200
@@ -100,7 +100,7 @@
         self.assertEqual(response.status, 200)
         self.assertEqual(response.getheader("Content-type"), "text/html")
 
-        # Server throws an exception if we don't start to read the data
+        # Server raises an exception if we don't start to read the data
         response.read()
 
     def test_invalid_get_response(self):
diff -r b0935ef48186 Lib/test/test_imaplib.py
--- a/Lib/test/test_imaplib.py	Sun Dec 16 13:55:47 2012 +0100
+++ b/Lib/test/test_imaplib.py	Tue Dec 18 20:06:01 2012 +0200
@@ -79,7 +79,7 @@
                         return
                     line += part
                 except IOError:
-                    # ..but SSLSockets throw exceptions.
+                    # ..but SSLSockets raise exceptions.
                     return
                 if line.endswith('\r\n'):
                     break
diff -r b0935ef48186 Lib/test/test_minidom.py
--- a/Lib/test/test_minidom.py	Sun Dec 16 13:55:47 2012 +0100
+++ b/Lib/test/test_minidom.py	Tue Dec 18 20:06:01 2012 +0200
@@ -1060,7 +1060,7 @@
                 '<?xml version="1.0" encoding="iso-8859-15"?><foo>\xa4</foo>',
                 "testEncodings - encoding EURO SIGN")
 
-        # Verify that character decoding errors throw exceptions instead
+        # Verify that character decoding errors raise exceptions instead
         # of crashing
         self.assertRaises(UnicodeDecodeError, parseString,
                 '<fran\xe7ais>Comment \xe7a va ? Tr\xe8s bien ?</fran\xe7ais>')
diff -r b0935ef48186 Lib/test/test_os.py
--- a/Lib/test/test_os.py	Sun Dec 16 13:55:47 2012 +0100
+++ b/Lib/test/test_os.py	Tue Dec 18 20:06:01 2012 +0200
@@ -214,33 +214,33 @@
 
         try:
             result[200]
-            self.fail("No exception thrown")
+            self.fail("No exception raised")
         except IndexError:
             pass
 
         # Make sure that assignment fails
         try:
             result.st_mode = 1
-            self.fail("No exception thrown")
+            self.fail("No exception raised")
         except (AttributeError, TypeError):
             pass
 
         try:
             result.st_rdev = 1
-            self.fail("No exception thrown")
+            self.fail("No exception raised")
         except (AttributeError, TypeError):
             pass
 
         try:
             result.parrot = 1
-            self.fail("No exception thrown")
+            self.fail("No exception raised")
         except AttributeError:
             pass
 
         # Use the stat_result constructor with a too-short tuple.
         try:
             result2 = os.stat_result((10,))
-            self.fail("No exception thrown")
+            self.fail("No exception raised")
         except TypeError:
             pass
 
@@ -274,20 +274,20 @@
         # Make sure that assignment really fails
         try:
             result.f_bfree = 1
-            self.fail("No exception thrown")
+            self.fail("No exception raised")
         except TypeError:
             pass
 
         try:
             result.parrot = 1
-            self.fail("No exception thrown")
+            self.fail("No exception raised")
         except AttributeError:
             pass
 
         # Use the constructor with a too-short tuple.
         try:
             result2 = os.statvfs_result((10,))
-            self.fail("No exception thrown")
+            self.fail("No exception raised")
         except TypeError:
             pass
 
diff -r b0935ef48186 Lib/test/test_pty.py
--- a/Lib/test/test_pty.py	Sun Dec 16 13:55:47 2012 +0100
+++ b/Lib/test/test_pty.py	Tue Dec 18 20:06:01 2012 +0200
@@ -152,7 +152,7 @@
             # platform-dependent amount of data is written to its fd.  On
             # Linux 2.6, it's 4000 bytes and the child won't block, but on OS
             # X even the small writes in the child above will block it.  Also
-            # on Linux, the read() will throw an OSError (input/output error)
+            # on Linux, the read() will raise an OSError (input/output error)
             # when it tries to read past the end of the buffer but the child's
             # already exited, so catch and discard those exceptions.  It's not
             # worth checking for EIO.
diff -r b0935ef48186 Lib/test/test_sax.py
--- a/Lib/test/test_sax.py	Sun Dec 16 13:55:47 2012 +0100
+++ b/Lib/test/test_sax.py	Tue Dec 18 20:06:01 2012 +0200
@@ -294,7 +294,7 @@
     def test_5027_1(self):
         # The xml prefix (as in xml:lang below) is reserved and bound by
         # definition to http://www.w3.org/XML/1998/namespace.  XMLGenerator had
-        # a bug whereby a KeyError is thrown because this namespace is missing
+        # a bug whereby a KeyError is raised because this namespace is missing
         # from a dictionary.
         #
         # This test demonstrates the bug by parsing a document.
@@ -320,7 +320,7 @@
     def test_5027_2(self):
         # The xml prefix (as in xml:lang below) is reserved and bound by
         # definition to http://www.w3.org/XML/1998/namespace.  XMLGenerator had
-        # a bug whereby a KeyError is thrown because this namespace is missing
+        # a bug whereby a KeyError is raised because this namespace is missing
         # from a dictionary.
         #
         # This test demonstrates the bug by direct manipulation of the
diff -r b0935ef48186 Lib/test/test_signal.py
--- a/Lib/test/test_signal.py	Sun Dec 16 13:55:47 2012 +0100
+++ b/Lib/test/test_signal.py	Tue Dec 18 20:06:01 2012 +0200
@@ -109,7 +109,7 @@
             # This wait should be interrupted by the signal's exception.
             self.wait(child)
             time.sleep(1)  # Give the signal time to be delivered.
-            self.fail('HandlerBCalled exception not thrown')
+            self.fail('HandlerBCalled exception not raised')
         except HandlerBCalled:
             self.assertTrue(self.b_called)
             self.assertFalse(self.a_called)
@@ -148,7 +148,7 @@
         # test-running process from all the signals. It then
         # communicates with that child process over a pipe and
         # re-raises information about any exceptions the child
-        # throws. The real work happens in self.run_test().
+        # raises. The real work happens in self.run_test().
         os_done_r, os_done_w = os.pipe()
         with closing(os.fdopen(os_done_r)) as done_r, \
              closing(os.fdopen(os_done_w, 'w')) as done_w:
diff -r b0935ef48186 Lib/test/test_socketserver.py
--- a/Lib/test/test_socketserver.py	Sun Dec 16 13:55:47 2012 +0100
+++ b/Lib/test/test_socketserver.py	Tue Dec 18 20:06:01 2012 +0200
@@ -58,7 +58,7 @@
 def simple_subprocess(testcase):
     pid = os.fork()
     if pid == 0:
-        # Don't throw an exception; it would be caught by the test harness.
+        # Don't raise an exception; it would be caught by the test harness.
         os._exit(72)
     yield None
     pid2, status = os.waitpid(pid, 0)
diff -r b0935ef48186 Lib/test/test_sys_settrace.py
--- a/Lib/test/test_sys_settrace.py	Sun Dec 16 13:55:47 2012 +0100
+++ b/Lib/test/test_sys_settrace.py	Tue Dec 18 20:06:01 2012 +0200
@@ -417,7 +417,7 @@
                 except ValueError:
                     pass
                 else:
-                    self.fail("exception not thrown!")
+                    self.fail("exception not raised!")
         except RuntimeError:
             self.fail("recursion counter not reset")
 
diff -r b0935ef48186 Lib/test/test_time.py
--- a/Lib/test/test_time.py	Sun Dec 16 13:55:47 2012 +0100
+++ b/Lib/test/test_time.py	Tue Dec 18 20:06:01 2012 +0200
@@ -106,7 +106,7 @@
 
     def test_strptime(self):
         # Should be able to go round-trip from strftime to strptime without
-        # throwing an exception.
+        # raising an exception.
         tt = time.gmtime(self.t)
         for directive in ('a', 'A', 'b', 'B', 'c', 'd', 'H', 'I',
                           'j', 'm', 'M', 'p', 'S',
diff -r b0935ef48186 Lib/test/test_uu.py
--- a/Lib/test/test_uu.py	Sun Dec 16 13:55:47 2012 +0100
+++ b/Lib/test/test_uu.py	Tue Dec 18 20:06:01 2012 +0200
@@ -48,7 +48,7 @@
         out = cStringIO.StringIO()
         try:
             uu.decode(inp, out)
-            self.fail("No exception thrown")
+            self.fail("No exception raised")
         except uu.Error, e:
             self.assertEqual(str(e), "Truncated input file")
 
@@ -57,7 +57,7 @@
         out = cStringIO.StringIO()
         try:
             uu.decode(inp, out)
-            self.fail("No exception thrown")
+            self.fail("No exception raised")
         except uu.Error, e:
             self.assertEqual(str(e), "No valid begin line found in input file")
 
diff -r b0935ef48186 Lib/test/test_winreg.py
--- a/Lib/test/test_winreg.py	Sun Dec 16 13:55:47 2012 +0100
+++ b/Lib/test/test_winreg.py	Tue Dec 18 20:06:01 2012 +0200
@@ -234,7 +234,7 @@
 
     def test_changing_value(self):
         # Issue2810: A race condition in 2.6 and 3.1 may cause
-        # EnumValue or QueryValue to throw "WindowsError: More data is
+        # EnumValue or QueryValue to raise "WindowsError: More data is
         # available"
         done = False
 
@@ -282,7 +282,7 @@
 
     def test_dynamic_key(self):
         # Issue2810, when the value is dynamically generated, these
-        # throw "WindowsError: More data is available" in 2.6 and 3.1
+        # raise "WindowsError: More data is available" in 2.6 and 3.1
         try:
             EnumValue(HKEY_PERFORMANCE_DATA, 0)
         except OSError as e:
diff -r b0935ef48186 Lib/test/test_zipfile.py
--- a/Lib/test/test_zipfile.py	Sun Dec 16 13:55:47 2012 +0100
+++ b/Lib/test/test_zipfile.py	Tue Dec 18 20:06:01 2012 +0200
@@ -811,7 +811,7 @@
         with zipfile.ZipFile(data, mode="w") as zipf:
             zipf.writestr("foo.txt", "O, for a Muse of Fire!")
 
-        # This is correct; calling .read on a closed ZipFile should throw
+        # This is correct; calling .read on a closed ZipFile should raise
         # a RuntimeError, and so should calling .testzip.  An earlier
         # version of .testzip would swallow this exception (and any other)
         # and report that the first file in the archive was corrupt.
diff -r b0935ef48186 Lib/traceback.py
--- a/Lib/traceback.py	Sun Dec 16 13:55:47 2012 +0100
+++ b/Lib/traceback.py	Tue Dec 18 20:06:01 2012 +0200
@@ -166,7 +166,7 @@
     # >>> raise string1, string2  # deprecated
     #
     # Clear these out first because issubtype(string1, SyntaxError)
-    # would throw another exception and mask the original problem.
+    # would raise another exception and mask the original problem.
     if (isinstance(etype, BaseException) or
         isinstance(etype, types.InstanceType) or
         etype is None or type(etype) is str):
diff -r b0935ef48186 Lib/unittest/case.py
--- a/Lib/unittest/case.py	Sun Dec 16 13:55:47 2012 +0100
+++ b/Lib/unittest/case.py	Tue Dec 18 20:06:01 2012 +0200
@@ -447,10 +447,10 @@
 
 
     def assertRaises(self, excClass, callableObj=None, *args, **kwargs):
-        """Fail unless an exception of class excClass is thrown
+        """Fail unless an exception of class excClass is raised
            by callableObj when invoked with arguments args and keyword
            arguments kwargs. If a different type of exception is
-           thrown, it will not be caught, and the test case will be
+           raised, it will not be caught, and the test case will be
            deemed to have suffered an error, exactly as for an
            unexpected exception.
 
diff -r b0935ef48186 Lib/wsgiref/validate.py
--- a/Lib/wsgiref/validate.py	Sun Dec 16 13:55:47 2012 +0100
+++ b/Lib/wsgiref/validate.py	Tue Dec 18 20:06:01 2012 +0200
@@ -134,9 +134,9 @@
     When applied between a WSGI server and a WSGI application, this
     middleware will check for WSGI compliancy on a number of levels.
     This middleware does not modify the request or response in any
-    way, but will throw an AssertionError if anything seems off
+    way, but will raise an AssertionError if anything seems off
     (except for a failure to close the application iterator, which
-    will be printed to stderr -- there's no way to throw an exception
+    will be printed to stderr -- there's no way to raise an exception
     at that point).
     """
 
diff -r b0935ef48186 Lib/xml/sax/_exceptions.py
--- a/Lib/xml/sax/_exceptions.py	Sun Dec 16 13:55:47 2012 +0100
+++ b/Lib/xml/sax/_exceptions.py	Tue Dec 18 20:06:01 2012 +0200
@@ -12,7 +12,7 @@
     the application: you can subclass it to provide additional
     functionality, or to add localization. Note that although you will
     receive a SAXException as the argument to the handlers in the
-    ErrorHandler interface, you are not actually required to throw
+    ErrorHandler interface, you are not actually required to raise
     the exception; instead, you can simply read the information in
     it."""
 
@@ -50,7 +50,7 @@
     the original XML document. Note that although the application will
     receive a SAXParseException as the argument to the handlers in the
     ErrorHandler interface, the application is not actually required
-    to throw the exception; instead, it can simply read the
+    to raise the exception; instead, it can simply read the
     information in it and take a different action.
 
     Since this exception is a subclass of SAXException, it inherits
@@ -62,7 +62,7 @@
         self._locator = locator
 
         # We need to cache this stuff at construction time.
-        # If this exception is thrown, the objects through which we must
+        # If this exception is raised, the objects through which we must
         # traverse to get this information may be deleted by the time
         # it gets caught.
         self._systemId = self._locator.getSystemId()
diff -r b0935ef48186 Lib/xml/sax/xmlreader.py
--- a/Lib/xml/sax/xmlreader.py	Sun Dec 16 13:55:47 2012 +0100
+++ b/Lib/xml/sax/xmlreader.py	Tue Dec 18 20:06:01 2012 +0200
@@ -68,7 +68,7 @@
 
         SAX parsers are not required to provide localization for errors
         and warnings; if they cannot support the requested locale,
-        however, they must throw a SAX exception. Applications may
+        however, they must raise a SAX exception. Applications may
         request a locale change in the middle of a parse."""
         raise SAXNotSupportedException("Locale support not implemented")
 
diff -r b0935ef48186 Lib/xmlrpclib.py
--- a/Lib/xmlrpclib.py	Sun Dec 16 13:55:47 2012 +0100
+++ b/Lib/xmlrpclib.py	Tue Dec 18 20:06:01 2012 +0200
@@ -945,7 +945,7 @@
 
 class MultiCallIterator:
     """Iterates over the results of a multicall. Exceptions are
-    thrown in response to xmlrpc faults."""
+    raised in response to xmlrpc faults."""
 
     def __init__(self, results):
         self.results = results
diff -r b0935ef48186 Modules/_io/_iomodule.c
--- a/Modules/_io/_iomodule.c	Sun Dec 16 13:55:47 2012 +0100
+++ b/Modules/_io/_iomodule.c	Tue Dec 18 20:06:01 2012 +0200
@@ -59,7 +59,7 @@
 "At the top of the I/O hierarchy is the abstract base class IOBase. It\n"
 "defines the basic interface to a stream. Note, however, that there is no\n"
 "separation between reading and writing to streams; implementations are\n"
-"allowed to throw an IOError if they do not support a given operation.\n"
+"allowed to raise an IOError if they do not support a given operation.\n"
 "\n"
 "Extending IOBase is RawIOBase which deals simply with the reading and\n"
 "writing of raw bytes to a stream. FileIO subclasses RawIOBase to provide\n"
diff -r b0935ef48186 Modules/parsermodule.c
--- a/Modules/parsermodule.c	Sun Dec 16 13:55:47 2012 +0100
+++ b/Modules/parsermodule.c	Tue Dec 18 20:06:01 2012 +0200
@@ -698,7 +698,7 @@
             err_string("parse tree does not use a valid start symbol");
         }
     }
-    /*  Make sure we throw an exception on all errors.  We should never
+    /*  Make sure we raise an exception on all errors.  We should never
      *  get this, but we'd do well to be sure something is done.
      */
     if (st == NULL && !PyErr_Occurred())
@@ -813,7 +813,7 @@
         else if (!ISNONTERMINAL(type)) {
             /*
              *  It has to be one or the other; this is an error.
-             *  Throw an exception.
+             *  Raise an exception.
              */
             PyObject *err = Py_BuildValue("os", elem, "unknown node type.");
             PyErr_SetObject(parser_error, err);
@@ -863,7 +863,7 @@
     if (ISTERMINAL(num)) {
         /*
          *  The tuple is simple, but it doesn't start with a start symbol.
-         *  Throw an exception now and be done with it.
+         *  Raise an exception now and be done with it.
          */
         tuple = Py_BuildValue("os", tuple,
                     "Illegal syntax-tree; cannot start with terminal symbol.");
diff -r b0935ef48186 Modules/posixmodule.c
--- a/Modules/posixmodule.c	Sun Dec 16 13:55:47 2012 +0100
+++ b/Modules/posixmodule.c	Tue Dec 18 20:06:01 2012 +0200
@@ -349,7 +349,7 @@
 
 #if defined _MSC_VER && _MSC_VER >= 1400
 /* Microsoft CRT in VS2005 and higher will verify that a filehandle is
- * valid and throw an assertion if it isn't.
+ * valid and raise an assertion if it isn't.
  * Normally, an invalid fd is likely to be a C program error and therefore
  * an assertion can be useful, but it does contradict the POSIX standard
  * which for write(2) states:
diff -r b0935ef48186 Tools/scripts/serve.py
--- a/Tools/scripts/serve.py	Sun Dec 16 13:55:47 2012 +0100
+++ b/Tools/scripts/serve.py	Tue Dec 18 20:06:01 2012 +0200
@@ -2,7 +2,7 @@
 '''
 Small wsgiref based web server. Takes a path to serve from and an
 optional port number (defaults to 8000), then tries to serve files.
-Mime types are guessed from the file names, 404 errors are thrown
+Mime types are guessed from the file names, 404 errors are raised
 if the file is not found. Used for the make serve target in Doc.
 '''
 import sys
-------------- next part --------------
diff -r 907d71668d3c Doc/howto/cporting.rst
--- a/Doc/howto/cporting.rst	Sun Dec 16 21:10:35 2012 +0100
+++ b/Doc/howto/cporting.rst	Tue Dec 18 19:35:27 2012 +0200
@@ -253,7 +253,7 @@
 
   * :c:func:`PyCapsule_GetName` always returns NULL.
 
-  * :c:func:`PyCapsule_SetName` always throws an exception and
+  * :c:func:`PyCapsule_SetName` always raises an exception and
     returns failure.  (Since there's no way to store a name
     in a CObject, noisy failure of :c:func:`PyCapsule_SetName`
     was deemed preferable to silent failure here.  If this is
diff -r 907d71668d3c Doc/library/contextlib.rst
--- a/Doc/library/contextlib.rst	Sun Dec 16 21:10:35 2012 +0100
+++ b/Doc/library/contextlib.rst	Tue Dec 18 19:35:27 2012 +0200
@@ -184,7 +184,7 @@
           files = [stack.enter_context(open(fname)) for fname in filenames]
           # All opened files will automatically be closed at the end of
           # the with statement, even if attempts to open files later
-          # in the list throw an exception
+          # in the list raise an exception
 
    Each instance maintains a stack of registered callbacks that are called in
    reverse order when the instance is closed (either explicitly or implicitly
diff -r 907d71668d3c Doc/library/imaplib.rst
--- a/Doc/library/imaplib.rst	Sun Dec 16 21:10:35 2012 +0100
+++ b/Doc/library/imaplib.rst	Tue Dec 18 19:35:27 2012 +0200
@@ -75,7 +75,7 @@
    :class:`ssl.SSLContext` object which allows bundling SSL configuration
    options, certificates and private keys into a single (potentially long-lived)
    structure. Note that the *keyfile*/*certfile* parameters are mutually exclusive with *ssl_context*,
-   a :class:`ValueError` is thrown if *keyfile*/*certfile* is provided along with *ssl_context*.
+   a :class:`ValueError` is raised if *keyfile*/*certfile* is provided along with *ssl_context*.
 
    .. versionchanged:: 3.3
       *ssl_context* parameter added.
diff -r 907d71668d3c Doc/library/os.rst
--- a/Doc/library/os.rst	Sun Dec 16 21:10:35 2012 +0100
+++ b/Doc/library/os.rst	Tue Dec 18 19:35:27 2012 +0200
@@ -1171,7 +1171,7 @@
    output) specifies which file descriptor should be queried.
 
    If the file descriptor is not connected to a terminal, an :exc:`OSError`
-   is thrown.
+   is raised.
 
    :func:`shutil.get_terminal_size` is the high-level function which
    should normally be used, ``os.get_terminal_size`` is the low-level
@@ -1945,7 +1945,7 @@
    :mod:`os` module permit use of their *dir_fd* parameter.  Different platforms
    provide different functionality, and an option that might work on one might
    be unsupported on another.  For consistency's sakes, functions that support
-   *dir_fd* always allow specifying the parameter, but will throw an exception
+   *dir_fd* always allow specifying the parameter, but will raise an exception
    if the functionality is not actually available.
 
    To check whether a particular function permits use of its *dir_fd*
@@ -1986,7 +1986,7 @@
    descriptor.  Different platforms provide different functionality, and an
    option that might work on one might be unsupported on another.  For
    consistency's sakes, functions that support *fd* always allow specifying
-   the parameter, but will throw an exception if the functionality is not
+   the parameter, but will raise an exception if the functionality is not
    actually available.
 
    To check whether a particular function permits specifying an open file
@@ -2007,7 +2007,7 @@
    platforms provide different functionality, and an option that might work on
    one might be unsupported on another.  For consistency's sakes, functions that
    support *follow_symlinks* always allow specifying the parameter, but will
-   throw an exception if the functionality is not actually available.
+   raise an exception if the functionality is not actually available.
 
    To check whether a particular function permits use of its *follow_symlinks*
    parameter, use the ``in`` operator on ``supports_follow_symlinks``.  As an
diff -r 907d71668d3c Lib/asyncore.py
--- a/Lib/asyncore.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/asyncore.py	Tue Dec 18 19:35:27 2012 +0200
@@ -385,7 +385,7 @@
             else:
                 return data
         except socket.error as why:
-            # winsock sometimes throws ENOTCONN
+            # winsock sometimes raises ENOTCONN
             if why.args[0] in _DISCONNECTED:
                 self.handle_close()
                 return b''
diff -r 907d71668d3c Lib/contextlib.py
--- a/Lib/contextlib.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/contextlib.py	Tue Dec 18 19:35:27 2012 +0200
@@ -151,7 +151,7 @@
             files = [stack.enter_context(open(fname)) for fname in filenames]
             # All opened files will automatically be closed at the end of
             # the with statement, even if attempts to open files later
-            # in the list throw an exception
+            # in the list raise an exception
 
     """
     def __init__(self):
diff -r 907d71668d3c Lib/distutils/tests/test_msvc9compiler.py
--- a/Lib/distutils/tests/test_msvc9compiler.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/distutils/tests/test_msvc9compiler.py	Tue Dec 18 19:35:27 2012 +0200
@@ -104,7 +104,7 @@
                             unittest.TestCase):
 
     def test_no_compiler(self):
-        # makes sure query_vcvarsall throws
+        # makes sure query_vcvarsall raises
         # a DistutilsPlatformError if the compiler
         # is not found
         from distutils.msvc9compiler import query_vcvarsall
diff -r 907d71668d3c Lib/email/feedparser.py
--- a/Lib/email/feedparser.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/email/feedparser.py	Tue Dec 18 19:35:27 2012 +0200
@@ -13,7 +13,7 @@
 data.  When you have no more data to push into the parser, call .close().
 This completes the parsing and returns the root message object.
 
-The other advantage of this parser is that it will never throw a parsing
+The other advantage of this parser is that it will never raise a parsing
 exception.  Instead, when it finds something unexpected, it adds a 'defect' to
 the current message.  Defects are just instances that live on the message
 object's .defects attribute.
@@ -228,7 +228,7 @@
         # supposed to see in the body of the message.
         self._parse_headers(headers)
         # Headers-only parsing is a backwards compatibility hack, which was
-        # necessary in the older parser, which could throw errors.  All
+        # necessary in the older parser, which could raise errors.  All
         # remaining lines in the input are thrown into the message body.
         if self._headersonly:
             lines = []
diff -r 907d71668d3c Lib/email/header.py
--- a/Lib/email/header.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/email/header.py	Tue Dec 18 19:35:27 2012 +0200
@@ -298,7 +298,7 @@
             else:
                 s = s.decode(input_charset, errors)
         # Ensure that the bytes we're storing can be decoded to the output
-        # character set, otherwise an early error is thrown.
+        # character set, otherwise an early error is raised.
         output_charset = charset.output_codec or 'us-ascii'
         if output_charset != _charset.UNKNOWN8BIT:
             try:
diff -r 907d71668d3c Lib/email/utils.py
--- a/Lib/email/utils.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/email/utils.py	Tue Dec 18 19:35:27 2012 +0200
@@ -83,7 +83,7 @@
     'utf-8'.
     """
     name, address = pair
-    # The address MUST (per RFC) be ascii, so throw a UnicodeError if it isn't.
+    # The address MUST (per RFC) be ascii, so raise an UnicodeError if it isn't.
     address.encode('ascii')
     if name:
         try:
diff -r 907d71668d3c Lib/imaplib.py
--- a/Lib/imaplib.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/imaplib.py	Tue Dec 18 19:35:27 2012 +0200
@@ -1178,7 +1178,7 @@
                 ssl_context - a SSLContext object that contains your certificate chain
                               and private key (default: None)
                 Note: if ssl_context is provided, then parameters keyfile or
-                certfile should not be set otherwise ValueError is thrown.
+                certfile should not be set otherwise ValueError is raised.
 
         for more documentation see the docstring of the parent class IMAP4.
         """
diff -r 907d71668d3c Lib/io.py
--- a/Lib/io.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/io.py	Tue Dec 18 19:35:27 2012 +0200
@@ -4,7 +4,7 @@
 At the top of the I/O hierarchy is the abstract base class IOBase. It
 defines the basic interface to a stream. Note, however, that there is no
 separation between reading and writing to streams; implementations are
-allowed to throw an IOError if they do not support a given operation.
+allowed to raise an IOError if they do not support a given operation.
 
 Extending IOBase is RawIOBase which deals simply with the reading and
 writing of raw bytes to a stream. FileIO subclasses RawIOBase to provide
diff -r 907d71668d3c Lib/logging/__init__.py
--- a/Lib/logging/__init__.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/logging/__init__.py	Tue Dec 18 19:35:27 2012 +0200
@@ -1349,7 +1349,7 @@
         """
         sinfo = None
         if _srcfile:
-            #IronPython doesn't track Python frames, so findCaller throws an
+            #IronPython doesn't track Python frames, so findCaller raises an
             #exception on some versions of IronPython. We trap it here so that
             #IronPython can use logging.
             try:
@@ -1671,7 +1671,7 @@
        Added the ``style`` parameter.
 
     .. versionchanged:: 3.3
-       Added the ``handlers`` parameter. A ``ValueError`` is now thrown for
+       Added the ``handlers`` parameter. A ``ValueError`` is now raised for
        incompatible arguments (e.g. ``handlers`` specified together with
        ``filename``/``filemode``, or ``filename``/``filemode`` specified
        together with ``stream``, or ``handlers`` specified together with
diff -r 907d71668d3c Lib/multiprocessing/util.py
--- a/Lib/multiprocessing/util.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/multiprocessing/util.py	Tue Dec 18 19:35:27 2012 +0200
@@ -290,7 +290,7 @@
 
         if current_process() is not None:
             # We check if the current process is None here because if
-            # it's None, any call to ``active_children()`` will throw
+            # it's None, any call to ``active_children()`` will raise
             # an AttributeError (active_children winds up trying to
             # get attributes from util._current_process).  One
             # situation where this can happen is if someone has
diff -r 907d71668d3c Lib/pkgutil.py
--- a/Lib/pkgutil.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/pkgutil.py	Tue Dec 18 19:35:27 2012 +0200
@@ -504,7 +504,7 @@
         return importlib.find_loader(fullname, path)
     except (ImportError, AttributeError, TypeError, ValueError) as ex:
         # This hack fixes an impedance mismatch between pkgutil and
-        # importlib, where the latter throws other errors for cases where
+        # importlib, where the latter raises other errors for cases where
         # pkgutil previously threw ImportError
         msg = "Error while finding loader for {!r} ({}: {})"
         raise ImportError(msg.format(fullname, type(ex), ex)) from ex
diff -r 907d71668d3c Lib/tempfile.py
--- a/Lib/tempfile.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/tempfile.py	Tue Dec 18 19:35:27 2012 +0200
@@ -621,7 +621,7 @@
 
     def __init__(self, suffix="", prefix=template, dir=None):
         self._closed = False
-        self.name = None # Handle mkdtemp throwing an exception
+        self.name = None # Handle mkdtemp raising an exception
         self.name = mkdtemp(suffix, prefix, dir)
 
     def __repr__(self):
diff -r 907d71668d3c Lib/test/test_codeop.py
--- a/Lib/test/test_codeop.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/test/test_codeop.py	Tue Dec 18 19:35:27 2012 +0200
@@ -50,7 +50,7 @@
         '''succeed iff str is the start of an invalid piece of code'''
         try:
             compile_command(str,symbol=symbol)
-            self.fail("No exception thrown for invalid code")
+            self.fail("No exception raised for invalid code")
         except SyntaxError:
             self.assertTrue(is_syntax)
         except OverflowError:
diff -r 907d71668d3c Lib/test/test_docxmlrpc.py
--- a/Lib/test/test_docxmlrpc.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/test/test_docxmlrpc.py	Tue Dec 18 19:35:27 2012 +0200
@@ -100,7 +100,7 @@
         self.assertEqual(response.status, 200)
         self.assertEqual(response.getheader("Content-type"), "text/html")
 
-        # Server throws an exception if we don't start to read the data
+        # Server raises an exception if we don't start to read the data
         response.read()
 
     def test_invalid_get_response(self):
diff -r 907d71668d3c Lib/test/test_imaplib.py
--- a/Lib/test/test_imaplib.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/test/test_imaplib.py	Tue Dec 18 19:35:27 2012 +0200
@@ -115,7 +115,7 @@
                         return
                     line += part
                 except IOError:
-                    # ..but SSLSockets throw exceptions.
+                    # ..but SSLSockets raise exceptions.
                     return
                 if line.endswith(b'\r\n'):
                     break
diff -r 907d71668d3c Lib/test/test_minidom.py
--- a/Lib/test/test_minidom.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/test/test_minidom.py	Tue Dec 18 19:35:27 2012 +0200
@@ -1073,7 +1073,7 @@
             '<?xml version="1.0" encoding="utf-16"?>'
             '<foo>\u20ac</foo>'.encode('utf-16'))
 
-        # Verify that character decoding errors throw exceptions instead
+        # Verify that character decoding errors raise exceptions instead
         # of crashing
         self.assertRaises(UnicodeDecodeError, parseString,
                 b'<fran\xe7ais>Comment \xe7a va ? Tr\xe8s bien ?</fran\xe7ais>')
diff -r 907d71668d3c Lib/test/test_os.py
--- a/Lib/test/test_os.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/test/test_os.py	Tue Dec 18 19:35:27 2012 +0200
@@ -202,33 +202,33 @@
 
         try:
             result[200]
-            self.fail("No exception thrown")
+            self.fail("No exception raised")
         except IndexError:
             pass
 
         # Make sure that assignment fails
         try:
             result.st_mode = 1
-            self.fail("No exception thrown")
+            self.fail("No exception raised")
         except AttributeError:
             pass
 
         try:
             result.st_rdev = 1
-            self.fail("No exception thrown")
+            self.fail("No exception raised")
         except (AttributeError, TypeError):
             pass
 
         try:
             result.parrot = 1
-            self.fail("No exception thrown")
+            self.fail("No exception raised")
         except AttributeError:
             pass
 
         # Use the stat_result constructor with a too-short tuple.
         try:
             result2 = os.stat_result((10,))
-            self.fail("No exception thrown")
+            self.fail("No exception raised")
         except TypeError:
             pass
 
@@ -273,20 +273,20 @@
         # Make sure that assignment really fails
         try:
             result.f_bfree = 1
-            self.fail("No exception thrown")
+            self.fail("No exception raised")
         except AttributeError:
             pass
 
         try:
             result.parrot = 1
-            self.fail("No exception thrown")
+            self.fail("No exception raised")
         except AttributeError:
             pass
 
         # Use the constructor with a too-short tuple.
         try:
             result2 = os.statvfs_result((10,))
-            self.fail("No exception thrown")
+            self.fail("No exception raised")
         except TypeError:
             pass
 
@@ -2018,7 +2018,7 @@
             size = os.get_terminal_size()
         except OSError as e:
             if sys.platform == "win32" or e.errno in (errno.EINVAL, errno.ENOTTY):
-                # Under win32 a generic OSError can be thrown if the
+                # Under win32 a generic OSError can be raised if the
                 # handle cannot be retrieved
                 self.skipTest("failed to query terminal size")
             raise
@@ -2043,7 +2043,7 @@
             actual = os.get_terminal_size(sys.__stdin__.fileno())
         except OSError as e:
             if sys.platform == "win32" or e.errno in (errno.EINVAL, errno.ENOTTY):
-                # Under win32 a generic OSError can be thrown if the
+                # Under win32 a generic OSError can be raised if the
                 # handle cannot be retrieved
                 self.skipTest("failed to query terminal size")
             raise
diff -r 907d71668d3c Lib/test/test_posix.py
--- a/Lib/test/test_posix.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/test/test_posix.py	Tue Dec 18 19:35:27 2012 +0200
@@ -824,7 +824,7 @@
             posix.rename(support.TESTFN + 'ren', support.TESTFN)
             raise
         else:
-            posix.stat(support.TESTFN) # should not throw exception
+            posix.stat(support.TESTFN) # should not raise exception
         finally:
             posix.close(f)
 
@@ -842,7 +842,7 @@
     def test_unlink_dir_fd(self):
         f = posix.open(posix.getcwd(), posix.O_RDONLY)
         support.create_empty_file(support.TESTFN + 'del')
-        posix.stat(support.TESTFN + 'del') # should not throw exception
+        posix.stat(support.TESTFN + 'del') # should not raise exception
         try:
             posix.unlink(support.TESTFN + 'del', dir_fd=f)
         except:
diff -r 907d71668d3c Lib/test/test_pty.py
--- a/Lib/test/test_pty.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/test/test_pty.py	Tue Dec 18 19:35:27 2012 +0200
@@ -152,7 +152,7 @@
             # platform-dependent amount of data is written to its fd.  On
             # Linux 2.6, it's 4000 bytes and the child won't block, but on OS
             # X even the small writes in the child above will block it.  Also
-            # on Linux, the read() will throw an OSError (input/output error)
+            # on Linux, the read() will raise an OSError (input/output error)
             # when it tries to read past the end of the buffer but the child's
             # already exited, so catch and discard those exceptions.  It's not
             # worth checking for EIO.
diff -r 907d71668d3c Lib/test/test_sax.py
--- a/Lib/test/test_sax.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/test/test_sax.py	Tue Dec 18 19:35:27 2012 +0200
@@ -389,7 +389,7 @@
     def test_5027_1(self):
         # The xml prefix (as in xml:lang below) is reserved and bound by
         # definition to http://www.w3.org/XML/1998/namespace.  XMLGenerator had
-        # a bug whereby a KeyError is thrown because this namespace is missing
+        # a bug whereby a KeyError is raised because this namespace is missing
         # from a dictionary.
         #
         # This test demonstrates the bug by parsing a document.
@@ -415,7 +415,7 @@
     def test_5027_2(self):
         # The xml prefix (as in xml:lang below) is reserved and bound by
         # definition to http://www.w3.org/XML/1998/namespace.  XMLGenerator had
-        # a bug whereby a KeyError is thrown because this namespace is missing
+        # a bug whereby a KeyError is raised because this namespace is missing
         # from a dictionary.
         #
         # This test demonstrates the bug by direct manipulation of the
diff -r 907d71668d3c Lib/test/test_signal.py
--- a/Lib/test/test_signal.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/test/test_signal.py	Tue Dec 18 19:35:27 2012 +0200
@@ -107,7 +107,7 @@
             # This wait should be interrupted by the signal's exception.
             self.wait(child)
             time.sleep(1)  # Give the signal time to be delivered.
-            self.fail('HandlerBCalled exception not thrown')
+            self.fail('HandlerBCalled exception not raised')
         except HandlerBCalled:
             self.assertTrue(self.b_called)
             self.assertFalse(self.a_called)
@@ -143,7 +143,7 @@
         # test-running process from all the signals. It then
         # communicates with that child process over a pipe and
         # re-raises information about any exceptions the child
-        # throws. The real work happens in self.run_test().
+        # raises. The real work happens in self.run_test().
         os_done_r, os_done_w = os.pipe()
         with closing(os.fdopen(os_done_r, 'rb')) as done_r, \
              closing(os.fdopen(os_done_w, 'wb')) as done_w:
diff -r 907d71668d3c Lib/test/test_socketserver.py
--- a/Lib/test/test_socketserver.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/test/test_socketserver.py	Tue Dec 18 19:35:27 2012 +0200
@@ -58,7 +58,7 @@
 def simple_subprocess(testcase):
     pid = os.fork()
     if pid == 0:
-        # Don't throw an exception; it would be caught by the test harness.
+        # Don't raise an exception; it would be caught by the test harness.
         os._exit(72)
     yield None
     pid2, status = os.waitpid(pid, 0)
diff -r 907d71668d3c Lib/test/test_sys_settrace.py
--- a/Lib/test/test_sys_settrace.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/test/test_sys_settrace.py	Tue Dec 18 19:35:27 2012 +0200
@@ -422,7 +422,7 @@
                 except ValueError:
                     pass
                 else:
-                    self.fail("exception not thrown!")
+                    self.fail("exception not raised!")
         except RuntimeError:
             self.fail("recursion counter not reset")
 
diff -r 907d71668d3c Lib/test/test_time.py
--- a/Lib/test/test_time.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/test/test_time.py	Tue Dec 18 19:35:27 2012 +0200
@@ -175,7 +175,7 @@
 
     def test_strptime(self):
         # Should be able to go round-trip from strftime to strptime without
-        # throwing an exception.
+        # raising an exception.
         tt = time.gmtime(self.t)
         for directive in ('a', 'A', 'b', 'B', 'c', 'd', 'H', 'I',
                           'j', 'm', 'M', 'p', 'S',
diff -r 907d71668d3c Lib/test/test_uu.py
--- a/Lib/test/test_uu.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/test/test_uu.py	Tue Dec 18 19:35:27 2012 +0200
@@ -80,7 +80,7 @@
         out = io.BytesIO()
         try:
             uu.decode(inp, out)
-            self.fail("No exception thrown")
+            self.fail("No exception raised")
         except uu.Error as e:
             self.assertEqual(str(e), "Truncated input file")
 
@@ -89,7 +89,7 @@
         out = io.BytesIO()
         try:
             uu.decode(inp, out)
-            self.fail("No exception thrown")
+            self.fail("No exception raised")
         except uu.Error as e:
             self.assertEqual(str(e), "No valid begin line found in input file")
 
diff -r 907d71668d3c Lib/test/test_winreg.py
--- a/Lib/test/test_winreg.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/test/test_winreg.py	Tue Dec 18 19:35:27 2012 +0200
@@ -245,7 +245,7 @@
 
     def test_changing_value(self):
         # Issue2810: A race condition in 2.6 and 3.1 may cause
-        # EnumValue or QueryValue to throw "WindowsError: More data is
+        # EnumValue or QueryValue to raise "WindowsError: More data is
         # available"
         done = False
 
@@ -291,7 +291,7 @@
 
     def test_dynamic_key(self):
         # Issue2810, when the value is dynamically generated, these
-        # throw "WindowsError: More data is available" in 2.6 and 3.1
+        # raise "WindowsError: More data is available" in 2.6 and 3.1
         try:
             EnumValue(HKEY_PERFORMANCE_DATA, 0)
         except OSError as e:
diff -r 907d71668d3c Lib/test/test_zipfile.py
--- a/Lib/test/test_zipfile.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/test/test_zipfile.py	Tue Dec 18 19:35:27 2012 +0200
@@ -1024,7 +1024,7 @@
         with zipfile.ZipFile(data, mode="w") as zipf:
             zipf.writestr("foo.txt", "O, for a Muse of Fire!")
 
-        # This is correct; calling .read on a closed ZipFile should throw
+        # This is correct; calling .read on a closed ZipFile should raise
         # a RuntimeError, and so should calling .testzip.  An earlier
         # version of .testzip would swallow this exception (and any other)
         # and report that the first file in the archive was corrupt.
diff -r 907d71668d3c Lib/tkinter/__init__.py
--- a/Lib/tkinter/__init__.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/tkinter/__init__.py	Tue Dec 18 19:35:27 2012 +0200
@@ -149,7 +149,7 @@
     pass
 
 def _exit(code=0):
-    """Internal function. Calling it will throw the exception SystemExit."""
+    """Internal function. Calling it will raise the exception SystemExit."""
     try:
         code = int(code)
     except ValueError:
diff -r 907d71668d3c Lib/unittest/case.py
--- a/Lib/unittest/case.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/unittest/case.py	Tue Dec 18 19:35:27 2012 +0200
@@ -542,10 +542,10 @@
             return  '%s : %s' % (safe_repr(standardMsg), safe_repr(msg))
 
     def assertRaises(self, excClass, callableObj=None, *args, **kwargs):
-        """Fail unless an exception of class excClass is thrown
+        """Fail unless an exception of class excClass is raised
            by callableObj when invoked with arguments args and keyword
            arguments kwargs. If a different type of exception is
-           thrown, it will not be caught, and the test case will be
+           raised, it will not be caught, and the test case will be
            deemed to have suffered an error, exactly as for an
            unexpected exception.
 
diff -r 907d71668d3c Lib/wsgiref/validate.py
--- a/Lib/wsgiref/validate.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/wsgiref/validate.py	Tue Dec 18 19:35:27 2012 +0200
@@ -139,9 +139,9 @@
     When applied between a WSGI server and a WSGI application, this
     middleware will check for WSGI compliancy on a number of levels.
     This middleware does not modify the request or response in any
-    way, but will throw an AssertionError if anything seems off
+    way, but will raise an AssertionError if anything seems off
     (except for a failure to close the application iterator, which
-    will be printed to stderr -- there's no way to throw an exception
+    will be printed to stderr -- there's no way to raise an exception
     at that point).
     """
 
diff -r 907d71668d3c Lib/xml/sax/_exceptions.py
--- a/Lib/xml/sax/_exceptions.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/xml/sax/_exceptions.py	Tue Dec 18 19:35:27 2012 +0200
@@ -12,7 +12,7 @@
     the application: you can subclass it to provide additional
     functionality, or to add localization. Note that although you will
     receive a SAXException as the argument to the handlers in the
-    ErrorHandler interface, you are not actually required to throw
+    ErrorHandler interface, you are not actually required to raise
     the exception; instead, you can simply read the information in
     it."""
 
@@ -50,7 +50,7 @@
     the original XML document. Note that although the application will
     receive a SAXParseException as the argument to the handlers in the
     ErrorHandler interface, the application is not actually required
-    to throw the exception; instead, it can simply read the
+    to raise the exception; instead, it can simply read the
     information in it and take a different action.
 
     Since this exception is a subclass of SAXException, it inherits
@@ -62,7 +62,7 @@
         self._locator = locator
 
         # We need to cache this stuff at construction time.
-        # If this exception is thrown, the objects through which we must
+        # If this exception is raised, the objects through which we must
         # traverse to get this information may be deleted by the time
         # it gets caught.
         self._systemId = self._locator.getSystemId()
diff -r 907d71668d3c Lib/xml/sax/xmlreader.py
--- a/Lib/xml/sax/xmlreader.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/xml/sax/xmlreader.py	Tue Dec 18 19:35:27 2012 +0200
@@ -68,7 +68,7 @@
 
         SAX parsers are not required to provide localization for errors
         and warnings; if they cannot support the requested locale,
-        however, they must throw a SAX exception. Applications may
+        however, they must raise a SAX exception. Applications may
         request a locale change in the middle of a parse."""
         raise SAXNotSupportedException("Locale support not implemented")
 
diff -r 907d71668d3c Lib/xmlrpc/client.py
--- a/Lib/xmlrpc/client.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Lib/xmlrpc/client.py	Tue Dec 18 19:35:27 2012 +0200
@@ -811,7 +811,7 @@
 
 class MultiCallIterator:
     """Iterates over the results of a multicall. Exceptions are
-    thrown in response to xmlrpc faults."""
+    raised in response to xmlrpc faults."""
 
     def __init__(self, results):
         self.results = results
diff -r 907d71668d3c Modules/_io/_iomodule.c
--- a/Modules/_io/_iomodule.c	Sun Dec 16 21:10:35 2012 +0100
+++ b/Modules/_io/_iomodule.c	Tue Dec 18 19:35:27 2012 +0200
@@ -60,7 +60,7 @@
 "At the top of the I/O hierarchy is the abstract base class IOBase. It\n"
 "defines the basic interface to a stream. Note, however, that there is no\n"
 "separation between reading and writing to streams; implementations are\n"
-"allowed to throw an IOError if they do not support a given operation.\n"
+"allowed to raise an IOError if they do not support a given operation.\n"
 "\n"
 "Extending IOBase is RawIOBase which deals simply with the reading and\n"
 "writing of raw bytes to a stream. FileIO subclasses RawIOBase to provide\n"
diff -r 907d71668d3c Modules/parsermodule.c
--- a/Modules/parsermodule.c	Sun Dec 16 21:10:35 2012 +0100
+++ b/Modules/parsermodule.c	Tue Dec 18 19:35:27 2012 +0200
@@ -696,7 +696,7 @@
             err_string("parse tree does not use a valid start symbol");
         }
     }
-    /*  Make sure we throw an exception on all errors.  We should never
+    /*  Make sure we raise an exception on all errors.  We should never
      *  get this, but we'd do well to be sure something is done.
      */
     if (st == NULL && !PyErr_Occurred())
@@ -802,7 +802,7 @@
         else if (!ISNONTERMINAL(type)) {
             /*
              *  It has to be one or the other; this is an error.
-             *  Throw an exception.
+             *  Raise an exception.
              */
             PyObject *err = Py_BuildValue("os", elem, "unknown node type.");
             PyErr_SetObject(parser_error, err);
@@ -854,7 +854,7 @@
     if (ISTERMINAL(num)) {
         /*
          *  The tuple is simple, but it doesn't start with a start symbol.
-         *  Throw an exception now and be done with it.
+         *  Raise an exception now and be done with it.
          */
         tuple = Py_BuildValue("os", tuple,
                     "Illegal syntax-tree; cannot start with terminal symbol.");
diff -r 907d71668d3c Modules/posixmodule.c
--- a/Modules/posixmodule.c	Sun Dec 16 21:10:35 2012 +0100
+++ b/Modules/posixmodule.c	Tue Dec 18 19:35:27 2012 +0200
@@ -798,7 +798,7 @@
 
 #if defined _MSC_VER && _MSC_VER >= 1400
 /* Microsoft CRT in VS2005 and higher will verify that a filehandle is
- * valid and throw an assertion if it isn't.
+ * valid and raise an assertion if it isn't.
  * Normally, an invalid fd is likely to be a C program error and therefore
  * an assertion can be useful, but it does contradict the POSIX standard
  * which for write(2) states:
@@ -2716,7 +2716,7 @@
         result = fchmodat(dir_fd, path.narrow, mode,
                           follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW);
         /*
-         * But wait!  We can't throw the exception without allowing threads,
+         * But wait!  We can't raise the exception without allowing threads,
          * and we can't do that in this nested scope.  (Macro trickery, sigh.)
          */
         fchmodat_nofollow_unsupported =
@@ -10617,7 +10617,7 @@
     "which file descriptor should be queried.\n"                           \
     "\n"                                                                   \
     "If the file descriptor is not connected to a terminal, an OSError\n"  \
-    "is thrown.\n"                                                         \
+    "is raised.\n"                                                         \
     "\n"                                                                   \
     "This function will only be defined if an implementation is\n"         \
     "available for this system.\n"                                         \
diff -r 907d71668d3c Tools/scripts/find_recursionlimit.py
--- a/Tools/scripts/find_recursionlimit.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Tools/scripts/find_recursionlimit.py	Tue Dec 18 19:35:27 2012 +0200
@@ -92,7 +92,7 @@
 def test_compiler_recursion():
     # The compiler uses a scaling factor to support additional levels
     # of recursion. This is a sanity check of that scaling to ensure
-    # it still throws RuntimeError even at higher recursion limits
+    # it still raises RuntimeError even at higher recursion limits
     compile("()" * (10 * sys.getrecursionlimit()), "<single>", "single")
 
 def check_limit(n, test_func_name):
diff -r 907d71668d3c Tools/scripts/serve.py
--- a/Tools/scripts/serve.py	Sun Dec 16 21:10:35 2012 +0100
+++ b/Tools/scripts/serve.py	Tue Dec 18 19:35:27 2012 +0200
@@ -2,7 +2,7 @@
 '''
 Small wsgiref based web server. Takes a path to serve from and an
 optional port number (defaults to 8000), then tries to serve files.
-Mime types are guessed from the file names, 404 errors are thrown
+Mime types are guessed from the file names, 404 errors are raised
 if the file is not found. Used for the make serve target in Doc.
 '''
 import sys
-------------- next part --------------
diff -r 2ecea81adab0 Doc/howto/cporting.rst
--- a/Doc/howto/cporting.rst	Sun Dec 16 16:09:11 2012 +0100
+++ b/Doc/howto/cporting.rst	Tue Dec 18 20:05:46 2012 +0200
@@ -253,7 +253,7 @@
 
   * :c:func:`PyCapsule_GetName` always returns NULL.
 
-  * :c:func:`PyCapsule_SetName` always throws an exception and
+  * :c:func:`PyCapsule_SetName` always raises an exception and
     returns failure.  (Since there's no way to store a name
     in a CObject, noisy failure of :c:func:`PyCapsule_SetName`
     was deemed preferable to silent failure here.  If this is
diff -r 2ecea81adab0 Lib/asyncore.py
--- a/Lib/asyncore.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Lib/asyncore.py	Tue Dec 18 20:05:46 2012 +0200
@@ -393,7 +393,7 @@
             else:
                 return data
         except socket.error as why:
-            # winsock sometimes throws ENOTCONN
+            # winsock sometimes raises ENOTCONN
             if why.args[0] in _DISCONNECTED:
                 self.handle_close()
                 return b''
diff -r 2ecea81adab0 Lib/distutils/tests/test_msvc9compiler.py
--- a/Lib/distutils/tests/test_msvc9compiler.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Lib/distutils/tests/test_msvc9compiler.py	Tue Dec 18 20:05:46 2012 +0200
@@ -104,7 +104,7 @@
                             unittest.TestCase):
 
     def test_no_compiler(self):
-        # makes sure query_vcvarsall throws
+        # makes sure query_vcvarsall raises
         # a DistutilsPlatformError if the compiler
         # is not found
         from distutils.msvc9compiler import query_vcvarsall
diff -r 2ecea81adab0 Lib/email/feedparser.py
--- a/Lib/email/feedparser.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Lib/email/feedparser.py	Tue Dec 18 20:05:46 2012 +0200
@@ -13,7 +13,7 @@
 data.  When you have no more data to push into the parser, call .close().
 This completes the parsing and returns the root message object.
 
-The other advantage of this parser is that it will never throw a parsing
+The other advantage of this parser is that it will never raise a parsing
 exception.  Instead, when it finds something unexpected, it adds a 'defect' to
 the current message.  Defects are just instances that live on the message
 object's .defects attribute.
@@ -214,7 +214,7 @@
         # supposed to see in the body of the message.
         self._parse_headers(headers)
         # Headers-only parsing is a backwards compatibility hack, which was
-        # necessary in the older parser, which could throw errors.  All
+        # necessary in the older parser, which could raise errors.  All
         # remaining lines in the input are thrown into the message body.
         if self._headersonly:
             lines = []
diff -r 2ecea81adab0 Lib/email/header.py
--- a/Lib/email/header.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Lib/email/header.py	Tue Dec 18 20:05:46 2012 +0200
@@ -280,7 +280,7 @@
             else:
                 s = s.decode(input_charset, errors)
         # Ensure that the bytes we're storing can be decoded to the output
-        # character set, otherwise an early error is thrown.
+        # character set, otherwise an early error is raised.
         output_charset = charset.output_codec or 'us-ascii'
         if output_charset != _charset.UNKNOWN8BIT:
             try:
diff -r 2ecea81adab0 Lib/importlib/_bootstrap.py
--- a/Lib/importlib/_bootstrap.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Lib/importlib/_bootstrap.py	Tue Dec 18 20:05:46 2012 +0200
@@ -415,7 +415,7 @@
                 source_mtime is not None):
             # If e.g. Jython ever implements imp.cache_from_source to have
             # their own cached file format, this block of code will most likely
-            # throw an exception.
+            # raise an exception.
             data = bytearray(imp.get_magic())
             data.extend(marshal._w_long(source_mtime))
             data.extend(marshal.dumps(code_object))
diff -r 2ecea81adab0 Lib/importlib/test/import_/test_fromlist.py
--- a/Lib/importlib/test/import_/test_fromlist.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Lib/importlib/test/import_/test_fromlist.py	Tue Dec 18 20:05:46 2012 +0200
@@ -39,7 +39,7 @@
 
     If a package is being imported, then what is listed in fromlist may be
     treated as a module to be imported [module]. But once again, even if
-    something in fromlist does not exist as a module, no error is thrown
+    something in fromlist does not exist as a module, no error is raised
     [no module]. And this extends to what is contained in __all__ when '*' is
     imported [using *]. And '*' does not need to be the only name in the
     fromlist [using * with others].
diff -r 2ecea81adab0 Lib/io.py
--- a/Lib/io.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Lib/io.py	Tue Dec 18 20:05:46 2012 +0200
@@ -4,7 +4,7 @@
 At the top of the I/O hierarchy is the abstract base class IOBase. It
 defines the basic interface to a stream. Note, however, that there is no
 separation between reading and writing to streams; implementations are
-allowed to throw an IOError if they do not support a given operation.
+allowed to raise an IOError if they do not support a given operation.
 
 Extending IOBase is RawIOBase which deals simply with the reading and
 writing of raw bytes to a stream. FileIO subclasses RawIOBase to provide
diff -r 2ecea81adab0 Lib/logging/__init__.py
--- a/Lib/logging/__init__.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Lib/logging/__init__.py	Tue Dec 18 20:05:46 2012 +0200
@@ -1355,7 +1355,7 @@
         """
         sinfo = None
         if _srcfile:
-            #IronPython doesn't track Python frames, so findCaller throws an
+            #IronPython doesn't track Python frames, so findCaller raises an
             #exception on some versions of IronPython. We trap it here so that
             #IronPython can use logging.
             try:
diff -r 2ecea81adab0 Lib/multiprocessing/util.py
--- a/Lib/multiprocessing/util.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Lib/multiprocessing/util.py	Tue Dec 18 20:05:46 2012 +0200
@@ -301,7 +301,7 @@
         _run_finalizers(0)
         if current_process() is not None:
             # We check if the current process is None here because if
-            # it's None, any call to ``active_children()`` will throw an
+            # it's None, any call to ``active_children()`` will raise an
             # AttributeError (active_children winds up trying to get
             # attributes from util._current_process).  This happens in a
             # variety of shutdown circumstances that are not well-understood
diff -r 2ecea81adab0 Lib/runpy.py
--- a/Lib/runpy.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Lib/runpy.py	Tue Dec 18 20:05:46 2012 +0200
@@ -211,7 +211,7 @@
                 pass
         else:
             # The following check looks a bit odd. The trick is that
-            # NullImporter throws ImportError if the supplied path is a
+            # NullImporter raises ImportError if the supplied path is a
             # *valid* directory entry (and hence able to be handled
             # by the standard import machinery)
             try:
diff -r 2ecea81adab0 Lib/tempfile.py
--- a/Lib/tempfile.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Lib/tempfile.py	Tue Dec 18 20:05:46 2012 +0200
@@ -625,7 +625,7 @@
 
     def __init__(self, suffix="", prefix=template, dir=None):
         self._closed = False
-        self.name = None # Handle mkdtemp throwing an exception
+        self.name = None # Handle mkdtemp raising an exception
         self.name = mkdtemp(suffix, prefix, dir)
 
     def __repr__(self):
diff -r 2ecea81adab0 Lib/test/test_codeop.py
--- a/Lib/test/test_codeop.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Lib/test/test_codeop.py	Tue Dec 18 20:05:46 2012 +0200
@@ -50,7 +50,7 @@
         '''succeed iff str is the start of an invalid piece of code'''
         try:
             compile_command(str,symbol=symbol)
-            self.fail("No exception thrown for invalid code")
+            self.fail("No exception raised for invalid code")
         except SyntaxError:
             self.assertTrue(is_syntax)
         except OverflowError:
diff -r 2ecea81adab0 Lib/test/test_docxmlrpc.py
--- a/Lib/test/test_docxmlrpc.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Lib/test/test_docxmlrpc.py	Tue Dec 18 20:05:46 2012 +0200
@@ -100,7 +100,7 @@
         self.assertEqual(response.status, 200)
         self.assertEqual(response.getheader("Content-type"), "text/html")
 
-        # Server throws an exception if we don't start to read the data
+        # Server raises an exception if we don't start to read the data
         response.read()
 
     def test_invalid_get_response(self):
diff -r 2ecea81adab0 Lib/test/test_imaplib.py
--- a/Lib/test/test_imaplib.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Lib/test/test_imaplib.py	Tue Dec 18 20:05:46 2012 +0200
@@ -99,7 +99,7 @@
                         return
                     line += part
                 except IOError:
-                    # ..but SSLSockets throw exceptions.
+                    # ..but SSLSockets raise exceptions.
                     return
                 if line.endswith(b'\r\n'):
                     break
diff -r 2ecea81adab0 Lib/test/test_minidom.py
--- a/Lib/test/test_minidom.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Lib/test/test_minidom.py	Tue Dec 18 20:05:46 2012 +0200
@@ -1085,7 +1085,7 @@
         self.assertEqual(doc.toxml('iso-8859-15'),
             b'<?xml version="1.0" encoding="iso-8859-15"?><foo>\xa4</foo>')
 
-        # Verify that character decoding errors throw exceptions instead
+        # Verify that character decoding errors raise exceptions instead
         # of crashing
         self.assertRaises(UnicodeDecodeError, parseString,
                 b'<fran\xe7ais>Comment \xe7a va ? Tr\xe8s bien ?</fran\xe7ais>')
diff -r 2ecea81adab0 Lib/test/test_os.py
--- a/Lib/test/test_os.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Lib/test/test_os.py	Tue Dec 18 20:05:46 2012 +0200
@@ -164,33 +164,33 @@
 
         try:
             result[200]
-            self.fail("No exception thrown")
+            self.fail("No exception raised")
         except IndexError:
             pass
 
         # Make sure that assignment fails
         try:
             result.st_mode = 1
-            self.fail("No exception thrown")
+            self.fail("No exception raised")
         except AttributeError:
             pass
 
         try:
             result.st_rdev = 1
-            self.fail("No exception thrown")
+            self.fail("No exception raised")
         except (AttributeError, TypeError):
             pass
 
         try:
             result.parrot = 1
-            self.fail("No exception thrown")
+            self.fail("No exception raised")
         except AttributeError:
             pass
 
         # Use the stat_result constructor with a too-short tuple.
         try:
             result2 = os.stat_result((10,))
-            self.fail("No exception thrown")
+            self.fail("No exception raised")
         except TypeError:
             pass
 
@@ -233,20 +233,20 @@
         # Make sure that assignment really fails
         try:
             result.f_bfree = 1
-            self.fail("No exception thrown")
+            self.fail("No exception raised")
         except AttributeError:
             pass
 
         try:
             result.parrot = 1
-            self.fail("No exception thrown")
+            self.fail("No exception raised")
         except AttributeError:
             pass
 
         # Use the constructor with a too-short tuple.
         try:
             result2 = os.statvfs_result((10,))
-            self.fail("No exception thrown")
+            self.fail("No exception raised")
         except TypeError:
             pass
 
diff -r 2ecea81adab0 Lib/test/test_pty.py
--- a/Lib/test/test_pty.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Lib/test/test_pty.py	Tue Dec 18 20:05:46 2012 +0200
@@ -152,7 +152,7 @@
             # platform-dependent amount of data is written to its fd.  On
             # Linux 2.6, it's 4000 bytes and the child won't block, but on OS
             # X even the small writes in the child above will block it.  Also
-            # on Linux, the read() will throw an OSError (input/output error)
+            # on Linux, the read() will raise an OSError (input/output error)
             # when it tries to read past the end of the buffer but the child's
             # already exited, so catch and discard those exceptions.  It's not
             # worth checking for EIO.
diff -r 2ecea81adab0 Lib/test/test_sax.py
--- a/Lib/test/test_sax.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Lib/test/test_sax.py	Tue Dec 18 20:05:46 2012 +0200
@@ -389,7 +389,7 @@
     def test_5027_1(self):
         # The xml prefix (as in xml:lang below) is reserved and bound by
         # definition to http://www.w3.org/XML/1998/namespace.  XMLGenerator had
-        # a bug whereby a KeyError is thrown because this namespace is missing
+        # a bug whereby a KeyError is raised because this namespace is missing
         # from a dictionary.
         #
         # This test demonstrates the bug by parsing a document.
@@ -415,7 +415,7 @@
     def test_5027_2(self):
         # The xml prefix (as in xml:lang below) is reserved and bound by
         # definition to http://www.w3.org/XML/1998/namespace.  XMLGenerator had
-        # a bug whereby a KeyError is thrown because this namespace is missing
+        # a bug whereby a KeyError is raised because this namespace is missing
         # from a dictionary.
         #
         # This test demonstrates the bug by direct manipulation of the
diff -r 2ecea81adab0 Lib/test/test_signal.py
--- a/Lib/test/test_signal.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Lib/test/test_signal.py	Tue Dec 18 20:05:46 2012 +0200
@@ -113,7 +113,7 @@
             # This wait should be interrupted by the signal's exception.
             self.wait(child)
             time.sleep(1)  # Give the signal time to be delivered.
-            self.fail('HandlerBCalled exception not thrown')
+            self.fail('HandlerBCalled exception not raised')
         except HandlerBCalled:
             self.assertTrue(self.b_called)
             self.assertFalse(self.a_called)
@@ -152,7 +152,7 @@
         # test-running process from all the signals. It then
         # communicates with that child process over a pipe and
         # re-raises information about any exceptions the child
-        # throws. The real work happens in self.run_test().
+        # raises. The real work happens in self.run_test().
         os_done_r, os_done_w = os.pipe()
         with closing(os.fdopen(os_done_r, 'rb')) as done_r, \
              closing(os.fdopen(os_done_w, 'wb')) as done_w:
diff -r 2ecea81adab0 Lib/test/test_socketserver.py
--- a/Lib/test/test_socketserver.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Lib/test/test_socketserver.py	Tue Dec 18 20:05:46 2012 +0200
@@ -58,7 +58,7 @@
 def simple_subprocess(testcase):
     pid = os.fork()
     if pid == 0:
-        # Don't throw an exception; it would be caught by the test harness.
+        # Don't raise an exception; it would be caught by the test harness.
         os._exit(72)
     yield None
     pid2, status = os.waitpid(pid, 0)
diff -r 2ecea81adab0 Lib/test/test_sys_settrace.py
--- a/Lib/test/test_sys_settrace.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Lib/test/test_sys_settrace.py	Tue Dec 18 20:05:46 2012 +0200
@@ -418,7 +418,7 @@
                 except ValueError:
                     pass
                 else:
-                    self.fail("exception not thrown!")
+                    self.fail("exception not raised!")
         except RuntimeError:
             self.fail("recursion counter not reset")
 
diff -r 2ecea81adab0 Lib/test/test_time.py
--- a/Lib/test/test_time.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Lib/test/test_time.py	Tue Dec 18 20:05:46 2012 +0200
@@ -106,7 +106,7 @@
 
     def test_strptime(self):
         # Should be able to go round-trip from strftime to strptime without
-        # throwing an exception.
+        # raising an exception.
         tt = time.gmtime(self.t)
         for directive in ('a', 'A', 'b', 'B', 'c', 'd', 'H', 'I',
                           'j', 'm', 'M', 'p', 'S',
diff -r 2ecea81adab0 Lib/test/test_uu.py
--- a/Lib/test/test_uu.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Lib/test/test_uu.py	Tue Dec 18 20:05:46 2012 +0200
@@ -80,7 +80,7 @@
         out = io.BytesIO()
         try:
             uu.decode(inp, out)
-            self.fail("No exception thrown")
+            self.fail("No exception raised")
         except uu.Error as e:
             self.assertEqual(str(e), "Truncated input file")
 
@@ -89,7 +89,7 @@
         out = io.BytesIO()
         try:
             uu.decode(inp, out)
-            self.fail("No exception thrown")
+            self.fail("No exception raised")
         except uu.Error as e:
             self.assertEqual(str(e), "No valid begin line found in input file")
 
diff -r 2ecea81adab0 Lib/test/test_winreg.py
--- a/Lib/test/test_winreg.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Lib/test/test_winreg.py	Tue Dec 18 20:05:46 2012 +0200
@@ -245,7 +245,7 @@
 
     def test_changing_value(self):
         # Issue2810: A race condition in 2.6 and 3.1 may cause
-        # EnumValue or QueryValue to throw "WindowsError: More data is
+        # EnumValue or QueryValue to raise "WindowsError: More data is
         # available"
         done = False
 
@@ -291,7 +291,7 @@
 
     def test_dynamic_key(self):
         # Issue2810, when the value is dynamically generated, these
-        # throw "WindowsError: More data is available" in 2.6 and 3.1
+        # raise "WindowsError: More data is available" in 2.6 and 3.1
         try:
             EnumValue(HKEY_PERFORMANCE_DATA, 0)
         except OSError as e:
diff -r 2ecea81adab0 Lib/test/test_zipfile.py
--- a/Lib/test/test_zipfile.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Lib/test/test_zipfile.py	Tue Dec 18 20:05:46 2012 +0200
@@ -873,7 +873,7 @@
         with zipfile.ZipFile(data, mode="w") as zipf:
             zipf.writestr("foo.txt", "O, for a Muse of Fire!")
 
-        # This is correct; calling .read on a closed ZipFile should throw
+        # This is correct; calling .read on a closed ZipFile should raise
         # a RuntimeError, and so should calling .testzip.  An earlier
         # version of .testzip would swallow this exception (and any other)
         # and report that the first file in the archive was corrupt.
diff -r 2ecea81adab0 Lib/tkinter/__init__.py
--- a/Lib/tkinter/__init__.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Lib/tkinter/__init__.py	Tue Dec 18 20:05:46 2012 +0200
@@ -147,7 +147,7 @@
     pass
 
 def _exit(code=0):
-    """Internal function. Calling it will throw the exception SystemExit."""
+    """Internal function. Calling it will raise the exception SystemExit."""
     try:
         code = int(code)
     except ValueError:
diff -r 2ecea81adab0 Lib/unittest/case.py
--- a/Lib/unittest/case.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Lib/unittest/case.py	Tue Dec 18 20:05:46 2012 +0200
@@ -528,10 +528,10 @@
 
 
     def assertRaises(self, excClass, callableObj=None, *args, **kwargs):
-        """Fail unless an exception of class excClass is thrown
+        """Fail unless an exception of class excClass is raised
            by callableObj when invoked with arguments args and keyword
            arguments kwargs. If a different type of exception is
-           thrown, it will not be caught, and the test case will be
+           raised, it will not be caught, and the test case will be
            deemed to have suffered an error, exactly as for an
            unexpected exception.
 
diff -r 2ecea81adab0 Lib/wsgiref/validate.py
--- a/Lib/wsgiref/validate.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Lib/wsgiref/validate.py	Tue Dec 18 20:05:46 2012 +0200
@@ -139,9 +139,9 @@
     When applied between a WSGI server and a WSGI application, this
     middleware will check for WSGI compliancy on a number of levels.
     This middleware does not modify the request or response in any
-    way, but will throw an AssertionError if anything seems off
+    way, but will raise an AssertionError if anything seems off
     (except for a failure to close the application iterator, which
-    will be printed to stderr -- there's no way to throw an exception
+    will be printed to stderr -- there's no way to raise an exception
     at that point).
     """
 
diff -r 2ecea81adab0 Lib/xml/sax/_exceptions.py
--- a/Lib/xml/sax/_exceptions.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Lib/xml/sax/_exceptions.py	Tue Dec 18 20:05:46 2012 +0200
@@ -12,7 +12,7 @@
     the application: you can subclass it to provide additional
     functionality, or to add localization. Note that although you will
     receive a SAXException as the argument to the handlers in the
-    ErrorHandler interface, you are not actually required to throw
+    ErrorHandler interface, you are not actually required to raise
     the exception; instead, you can simply read the information in
     it."""
 
@@ -50,7 +50,7 @@
     the original XML document. Note that although the application will
     receive a SAXParseException as the argument to the handlers in the
     ErrorHandler interface, the application is not actually required
-    to throw the exception; instead, it can simply read the
+    to raise the exception; instead, it can simply read the
     information in it and take a different action.
 
     Since this exception is a subclass of SAXException, it inherits
@@ -62,7 +62,7 @@
         self._locator = locator
 
         # We need to cache this stuff at construction time.
-        # If this exception is thrown, the objects through which we must
+        # If this exception is raised, the objects through which we must
         # traverse to get this information may be deleted by the time
         # it gets caught.
         self._systemId = self._locator.getSystemId()
diff -r 2ecea81adab0 Lib/xml/sax/xmlreader.py
--- a/Lib/xml/sax/xmlreader.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Lib/xml/sax/xmlreader.py	Tue Dec 18 20:05:46 2012 +0200
@@ -68,7 +68,7 @@
 
         SAX parsers are not required to provide localization for errors
         and warnings; if they cannot support the requested locale,
-        however, they must throw a SAX exception. Applications may
+        however, they must raise a SAX exception. Applications may
         request a locale change in the middle of a parse."""
         raise SAXNotSupportedException("Locale support not implemented")
 
diff -r 2ecea81adab0 Lib/xmlrpc/client.py
--- a/Lib/xmlrpc/client.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Lib/xmlrpc/client.py	Tue Dec 18 20:05:46 2012 +0200
@@ -800,7 +800,7 @@
 
 class MultiCallIterator:
     """Iterates over the results of a multicall. Exceptions are
-    thrown in response to xmlrpc faults."""
+    raised in response to xmlrpc faults."""
 
     def __init__(self, results):
         self.results = results
diff -r 2ecea81adab0 Modules/_io/_iomodule.c
--- a/Modules/_io/_iomodule.c	Sun Dec 16 16:09:11 2012 +0100
+++ b/Modules/_io/_iomodule.c	Tue Dec 18 20:05:46 2012 +0200
@@ -59,7 +59,7 @@
 "At the top of the I/O hierarchy is the abstract base class IOBase. It\n"
 "defines the basic interface to a stream. Note, however, that there is no\n"
 "separation between reading and writing to streams; implementations are\n"
-"allowed to throw an IOError if they do not support a given operation.\n"
+"allowed to raise an IOError if they do not support a given operation.\n"
 "\n"
 "Extending IOBase is RawIOBase which deals simply with the reading and\n"
 "writing of raw bytes to a stream. FileIO subclasses RawIOBase to provide\n"
diff -r 2ecea81adab0 Modules/parsermodule.c
--- a/Modules/parsermodule.c	Sun Dec 16 16:09:11 2012 +0100
+++ b/Modules/parsermodule.c	Tue Dec 18 20:05:46 2012 +0200
@@ -718,7 +718,7 @@
             err_string("parse tree does not use a valid start symbol");
         }
     }
-    /*  Make sure we throw an exception on all errors.  We should never
+    /*  Make sure we raise an exception on all errors.  We should never
      *  get this, but we'd do well to be sure something is done.
      */
     if (st == NULL && !PyErr_Occurred())
@@ -824,7 +824,7 @@
         else if (!ISNONTERMINAL(type)) {
             /*
              *  It has to be one or the other; this is an error.
-             *  Throw an exception.
+             *  Raise an exception.
              */
             PyObject *err = Py_BuildValue("os", elem, "unknown node type.");
             PyErr_SetObject(parser_error, err);
@@ -876,7 +876,7 @@
     if (ISTERMINAL(num)) {
         /*
          *  The tuple is simple, but it doesn't start with a start symbol.
-         *  Throw an exception now and be done with it.
+         *  Raise an exception now and be done with it.
          */
         tuple = Py_BuildValue("os", tuple,
                     "Illegal syntax-tree; cannot start with terminal symbol.");
diff -r 2ecea81adab0 Modules/posixmodule.c
--- a/Modules/posixmodule.c	Sun Dec 16 16:09:11 2012 +0100
+++ b/Modules/posixmodule.c	Tue Dec 18 20:05:46 2012 +0200
@@ -349,7 +349,7 @@
 
 #if defined _MSC_VER && _MSC_VER >= 1400
 /* Microsoft CRT in VS2005 and higher will verify that a filehandle is
- * valid and throw an assertion if it isn't.
+ * valid and raise an assertion if it isn't.
  * Normally, an invalid fd is likely to be a C program error and therefore
  * an assertion can be useful, but it does contradict the POSIX standard
  * which for write(2) states:
diff -r 2ecea81adab0 Tools/scripts/serve.py
--- a/Tools/scripts/serve.py	Sun Dec 16 16:09:11 2012 +0100
+++ b/Tools/scripts/serve.py	Tue Dec 18 20:05:46 2012 +0200
@@ -2,7 +2,7 @@
 '''
 Small wsgiref based web server. Takes a path to serve from and an
 optional port number (defaults to 8000), then tries to serve files.
-Mime types are guessed from the file names, 404 errors are thrown
+Mime types are guessed from the file names, 404 errors are raised
 if the file is not found. Used for the make serve target in Doc.
 '''
 import sys


More information about the docs mailing list