mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
Issue #19720: Suppressed context for some exceptions in importlib.
This commit is contained in:
parent
b6e2556d8f
commit
c4464052d9
3 changed files with 6 additions and 5 deletions
|
@ -2172,7 +2172,7 @@ def _find_and_load_unlocked(name, import_):
|
|||
path = parent_module.__path__
|
||||
except AttributeError:
|
||||
msg = (_ERR_MSG + '; {!r} is not a package').format(name, parent)
|
||||
raise ImportError(msg, name=name)
|
||||
raise ImportError(msg, name=name) from None
|
||||
spec = _find_spec(name, path)
|
||||
if spec is None:
|
||||
raise ImportError(_ERR_MSG.format(name), name=name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue