mirror of
https://github.com/python/cpython.git
synced 2025-11-24 20:30:18 +00:00
Issue #16714: use 'raise' exceptions, don't 'throw'.
Patch by Serhiy Storchaka.
This commit is contained in:
commit
5b89840d9c
42 changed files with 64 additions and 64 deletions
|
|
@ -504,7 +504,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