(data)
| 613 | |
| 614 | |
| 615 | def _zstd_decompress(data): |
| 616 | # A simple version of compression.zstd.decompress() as we cannot import |
| 617 | # that here as the stdlib itself could be being zipimported. |
| 618 | results = [] |
| 619 | while True: |
| 620 | decomp = _get_zstd_decompressor_class()() |
| 621 | results.append(decomp.decompress(data)) |
| 622 | if not decomp.eof: |
| 623 | raise ZipImportError("zipimport: zstd compressed data ended before " |
| 624 | "the end-of-stream marker") |
| 625 | data = decomp.unused_data |
| 626 | if not data: |
| 627 | break |
| 628 | return b"".join(results) |
| 629 | |
| 630 | |
| 631 | # Given a path to a Zip file and a toc_entry, return the (uncompressed) data. |
no test coverage detected
searching dependent graphs…