Issue #15767: back out 8a0ed9f63c6e, finishing the removal of

ModuleNotFoundError.
This commit is contained in:
Brett Cannon 2013-07-04 17:51:50 -04:00
parent 82da8886cc
commit 679ecb565b
17 changed files with 412 additions and 427 deletions

View file

@ -316,7 +316,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 issubclass(exc, ImportError) and value.name == path:
elif exc is ImportError and value.name == path:
# No such module in the path.
return None
else: