mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #15767: Use ModuleNotFoundError.
This commit is contained in:
parent
c943265ba5
commit
46f97b85a8
16 changed files with 337 additions and 284 deletions
|
@ -350,7 +350,7 @@ def safeimport(path, forceload=0, cache={}):
|
|||
elif exc is SyntaxError:
|
||||
# A SyntaxError occurred before we could execute the module.
|
||||
raise ErrorDuringImport(value.filename, info)
|
||||
elif exc is ImportError and value.name == path:
|
||||
elif issubclass(exc, ImportError) and value.name == path:
|
||||
# No such module in the path.
|
||||
return None
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue