mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Move test___all__ over to unittest.main() and use ModuleNotFoundError
This commit is contained in:
parent
603dcf2714
commit
c9a1bfed5d
5 changed files with 21 additions and 24 deletions
|
|
@ -18,18 +18,18 @@ import binascii
|
|||
try:
|
||||
import zlib # We may need its compression method
|
||||
crc32 = zlib.crc32
|
||||
except ImportError:
|
||||
except ModuleNotFoundError:
|
||||
zlib = None
|
||||
crc32 = binascii.crc32
|
||||
|
||||
try:
|
||||
import bz2 # We may need its compression method
|
||||
except ImportError:
|
||||
except ModuleNotFoundError:
|
||||
bz2 = None
|
||||
|
||||
try:
|
||||
import lzma # We may need its compression method
|
||||
except ImportError:
|
||||
except ModuleNotFoundError:
|
||||
lzma = None
|
||||
|
||||
__all__ = ["BadZipFile", "BadZipfile", "error",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue