MCPcopy Index your code
hub / github.com/python/cpython / _check_compression

Function _check_compression

Lib/zipfile/__init__.py:823–843  ·  view source on GitHub ↗
(compression)

Source from the content-addressed store, hash-verified

821}
822
823def _check_compression(compression):
824 if compression == ZIP_STORED:
825 pass
826 elif compression == ZIP_DEFLATED:
827 if not zlib:
828 raise RuntimeError(
829 "Compression requires the (missing) zlib module")
830 elif compression == ZIP_BZIP2:
831 if not bz2:
832 raise RuntimeError(
833 "Compression requires the (missing) bz2 module")
834 elif compression == ZIP_LZMA:
835 if not lzma:
836 raise RuntimeError(
837 "Compression requires the (missing) lzma module")
838 elif compression == ZIP_ZSTANDARD:
839 if not zstd:
840 raise RuntimeError(
841 "Compression requires the (missing) compression.zstd module")
842 else:
843 raise NotImplementedError("That compression method is not supported")
844
845
846def _get_compressor(compress_type, compresslevel=None):

Callers 3

_get_decompressorFunction · 0.85
__init__Method · 0.85
_writecheckMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…