Issue #18200: Update the stdlib (except tests) to use

ModuleNotFoundError.
This commit is contained in:
Brett Cannon 2013-06-13 20:57:26 -04:00
parent 9702a17a6a
commit 0a140668fa
83 changed files with 144 additions and 158 deletions

View file

@ -52,13 +52,13 @@ if 'posix' in _names:
try:
from posix import _exit
__all__.append('_exit')
except ImportError:
except ModuleNotFoundError:
pass
import posixpath as path
try:
from posix import _have_functions
except ImportError:
except ModuleNotFoundError:
pass
elif 'nt' in _names:
@ -68,7 +68,7 @@ elif 'nt' in _names:
try:
from nt import _exit
__all__.append('_exit')
except ImportError:
except ModuleNotFoundError:
pass
import ntpath as path
@ -78,7 +78,7 @@ elif 'nt' in _names:
try:
from nt import _have_functions
except ImportError:
except ModuleNotFoundError:
pass
elif 'ce' in _names:
@ -88,7 +88,7 @@ elif 'ce' in _names:
try:
from ce import _exit
__all__.append('_exit')
except ImportError:
except ModuleNotFoundError:
pass
# We can use the standard Windows path.
import ntpath as path
@ -99,11 +99,11 @@ elif 'ce' in _names:
try:
from ce import _have_functions
except ImportError:
except ModuleNotFoundError:
pass
else:
raise ImportError('no os specific module found')
raise ModuleNotFoundError('no os specific module found')
sys.modules['os.path'] = path
from os.path import (curdir, pardir, sep, pathsep, defpath, extsep, altsep,