Commit 1f415cf2 authored by Andrew Svetlov's avatar Andrew Svetlov

replace threw with raised (#16714)

parents 08d02724 7bd61cbc
...@@ -505,7 +505,7 @@ def find_loader(fullname): ...@@ -505,7 +505,7 @@ def find_loader(fullname):
except (ImportError, AttributeError, TypeError, ValueError) as ex: except (ImportError, AttributeError, TypeError, ValueError) as ex:
# This hack fixes an impedance mismatch between pkgutil and # This hack fixes an impedance mismatch between pkgutil and
# importlib, where the latter raises other errors for cases where # importlib, where the latter raises other errors for cases where
# pkgutil previously threw ImportError # pkgutil previously raised ImportError
msg = "Error while finding loader for {!r} ({}: {})" msg = "Error while finding loader for {!r} ({}: {})"
raise ImportError(msg.format(fullname, type(ex), ex)) from ex raise ImportError(msg.format(fullname, type(ex), ex)) from ex
......
...@@ -1288,7 +1288,7 @@ class HandlerTests(unittest.TestCase): ...@@ -1288,7 +1288,7 @@ class HandlerTests(unittest.TestCase):
) )
def test_basic_and_digest_auth_handlers(self): def test_basic_and_digest_auth_handlers(self):
# HTTPDigestAuthHandler threw an exception if it couldn't handle a 40* # HTTPDigestAuthHandler raised an exception if it couldn't handle a 40*
# response (http://python.org/sf/1479302), where it should instead # response (http://python.org/sf/1479302), where it should instead
# return None to allow another handler (especially # return None to allow another handler (especially
# HTTPBasicAuthHandler) to handle the response. # HTTPBasicAuthHandler) to handle the response.
......
...@@ -277,7 +277,7 @@ class LocalWinregTests(BaseWinregTests): ...@@ -277,7 +277,7 @@ class LocalWinregTests(BaseWinregTests):
def test_long_key(self): def test_long_key(self):
# Issue2810, in 2.6 and 3.1 when the key name was exactly 256 # Issue2810, in 2.6 and 3.1 when the key name was exactly 256
# characters, EnumKey threw "WindowsError: More data is # characters, EnumKey raised "WindowsError: More data is
# available" # available"
name = 'x'*256 name = 'x'*256
try: try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment