mirror of
https://github.com/python/cpython.git
synced 2025-08-25 11:15:02 +00:00
Issue #16714: use 'raise' exceptions, don't 'throw'.
Patch by Serhiy Storchaka.
This commit is contained in:
commit
a191959849
42 changed files with 64 additions and 64 deletions
|
@ -502,7 +502,7 @@ def find_loader(fullname):
|
|||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue