(compression)
| 821 | } |
| 822 | |
| 823 | def _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 | |
| 846 | def _get_compressor(compress_type, compresslevel=None): |
no outgoing calls
no test coverage detected
searching dependent graphs…