mirror of
https://github.com/python/cpython.git
synced 2025-07-12 13:55:34 +00:00
Issue #18200: Back out usage of ModuleNotFoundError (8d28d44f3a9a)
This commit is contained in:
parent
fff59155d4
commit
cd171c8e92
83 changed files with 158 additions and 144 deletions
|
@ -17,17 +17,17 @@ try:
|
|||
import bz2
|
||||
del bz2
|
||||
_BZ2_SUPPORTED = True
|
||||
except ModuleNotFoundError:
|
||||
except ImportError:
|
||||
_BZ2_SUPPORTED = False
|
||||
|
||||
try:
|
||||
from pwd import getpwnam
|
||||
except ModuleNotFoundError:
|
||||
except ImportError:
|
||||
getpwnam = None
|
||||
|
||||
try:
|
||||
from grp import getgrnam
|
||||
except ModuleNotFoundError:
|
||||
except ImportError:
|
||||
getgrnam = None
|
||||
|
||||
__all__ = ["copyfileobj", "copyfile", "copymode", "copystat", "copy", "copy2",
|
||||
|
@ -668,7 +668,7 @@ def _make_zipfile(base_name, base_dir, verbose=0, dry_run=0, logger=None):
|
|||
# command.
|
||||
try:
|
||||
import zipfile
|
||||
except ModuleNotFoundError:
|
||||
except ImportError:
|
||||
zipfile = None
|
||||
|
||||
if zipfile is None:
|
||||
|
@ -858,7 +858,7 @@ def _unpack_zipfile(filename, extract_dir):
|
|||
"""
|
||||
try:
|
||||
import zipfile
|
||||
except ModuleNotFoundError:
|
||||
except ImportError:
|
||||
raise ReadError('zlib not supported, cannot unpack this archive.')
|
||||
|
||||
if not zipfile.is_zipfile(filename):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue