Issue #16714: use 'raise' exceptions, don't 'throw'.

Patch by Serhiy Storchaka.
diff --git a/Lib/test/test_codeop.py b/Lib/test/test_codeop.py
index d096293..b65423b 100644
--- a/Lib/test/test_codeop.py
+++ b/Lib/test/test_codeop.py
@@ -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 --git a/Lib/test/test_docxmlrpc.py b/Lib/test/test_docxmlrpc.py
index 60a69dd..d6ca458 100644
--- a/Lib/test/test_docxmlrpc.py
+++ b/Lib/test/test_docxmlrpc.py
@@ -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 --git a/Lib/test/test_imaplib.py b/Lib/test/test_imaplib.py
index 512bba9..06776de 100644
--- a/Lib/test/test_imaplib.py
+++ b/Lib/test/test_imaplib.py
@@ -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 --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py
index 0427ba3..5867b2d 100644
--- a/Lib/test/test_minidom.py
+++ b/Lib/test/test_minidom.py
@@ -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 --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 13a2b38..ede5f3f 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -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
 
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
index 4ad7350..f4e8aba 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -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 --git a/Lib/test/test_pty.py b/Lib/test/test_pty.py
index ef95268..29297f8 100644
--- a/Lib/test/test_pty.py
+++ b/Lib/test/test_pty.py
@@ -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 --git a/Lib/test/test_sax.py b/Lib/test/test_sax.py
index 8e00889..7bb30cd 100644
--- a/Lib/test/test_sax.py
+++ b/Lib/test/test_sax.py
@@ -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 --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py
index 6be259b..e87900a 100644
--- a/Lib/test/test_signal.py
+++ b/Lib/test/test_signal.py
@@ -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 --git a/Lib/test/test_socketserver.py b/Lib/test/test_socketserver.py
index 353f8ff..464057e 100644
--- a/Lib/test/test_socketserver.py
+++ b/Lib/test/test_socketserver.py
@@ -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 --git a/Lib/test/test_sys_settrace.py b/Lib/test/test_sys_settrace.py
index fdf958c..63ae1b7 100644
--- a/Lib/test/test_sys_settrace.py
+++ b/Lib/test/test_sys_settrace.py
@@ -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 --git a/Lib/test/test_time.py b/Lib/test/test_time.py
index 63e1453..da0f555 100644
--- a/Lib/test/test_time.py
+++ b/Lib/test/test_time.py
@@ -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 --git a/Lib/test/test_uu.py b/Lib/test/test_uu.py
index d6875c5..cbf6724 100644
--- a/Lib/test/test_uu.py
+++ b/Lib/test/test_uu.py
@@ -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 --git a/Lib/test/test_winreg.py b/Lib/test/test_winreg.py
index 55163c9..918b312 100644
--- a/Lib/test/test_winreg.py
+++ b/Lib/test/test_winreg.py
@@ -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 --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py
index 2e52c68..ac6983f 100644
--- a/Lib/test/test_zipfile.py
+++ b/Lib/test/test_zipfile.py
@@ -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.