diff options
author | Brett Cannon <brett@python.org> | 2013-07-04 22:16:15 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2013-07-04 22:16:15 (GMT) |
commit | 260fbe80c5bd3611ae9e896a3c4714527667aece (patch) | |
tree | aa4e3e522edf2af312a256702b8f43769faab2e0 /Lib/test/support.py | |
parent | 3dfd23245be19ff95cf50fe93c428dabf2ff90e7 (diff) | |
download | cpython-260fbe80c5bd3611ae9e896a3c4714527667aece.zip cpython-260fbe80c5bd3611ae9e896a3c4714527667aece.tar.gz cpython-260fbe80c5bd3611ae9e896a3c4714527667aece.tar.bz2 |
Issue #15767: Excise the remaining instances of ModuleNotFoundError
Diffstat (limited to 'Lib/test/support.py')
-rw-r--r-- | Lib/test/support.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Lib/test/support.py b/Lib/test/support.py index 5b7cfc2..d26e10c 100644 --- a/Lib/test/support.py +++ b/Lib/test/support.py @@ -29,32 +29,32 @@ import _testcapi try: import _thread, threading -except ModuleNotFoundError: +except ImportError: _thread = None threading = None try: import multiprocessing.process -except ModuleNotFoundError: +except ImportError: multiprocessing = None try: import zlib -except ModuleNotFoundError: +except ImportError: zlib = None try: import gzip -except ModuleNotFoundError: +except ImportError: gzip = None try: import bz2 -except ModuleNotFoundError: +except ImportError: bz2 = None try: import lzma -except ModuleNotFoundError: +except ImportError: lzma = None __all__ = [ @@ -121,7 +121,7 @@ def import_module(name, deprecated=False, *, required_on=()): with _ignore_deprecated_imports(deprecated): try: return importlib.import_module(name) - except ModuleNotFoundError as msg: + except ImportError as msg: if sys.platform.startswith(tuple(required_on)): raise raise unittest.SkipTest(str(msg)) @@ -193,7 +193,7 @@ def import_fresh_module(name, fresh=(), blocked=(), deprecated=False): if not _save_and_block_module(blocked_name, orig_modules): names_to_remove.append(blocked_name) fresh_module = importlib.import_module(name) - except ModuleNotFoundError: + except ImportError: fresh_module = None finally: for orig_name, module in orig_modules.items(): |