()
| 558 | # be imported. The function is cached when found, so subsequent calls |
| 559 | # don't import zlib again. |
| 560 | def _get_zlib_decompress_func(): |
| 561 | global _zlib_decompress |
| 562 | if _zlib_decompress: |
| 563 | return _zlib_decompress |
| 564 | |
| 565 | global _importing_zlib |
| 566 | if _importing_zlib: |
| 567 | # Someone has a zlib.py[co] in their Zip file |
| 568 | # let's avoid a stack overflow. |
| 569 | _bootstrap._verbose_message('zipimport: zlib UNAVAILABLE') |
| 570 | raise ZipImportError("can't decompress data; zlib not available") |
| 571 | |
| 572 | _importing_zlib = True |
| 573 | try: |
| 574 | from zlib import decompress as _zlib_decompress |
| 575 | except Exception: |
| 576 | _bootstrap._verbose_message('zipimport: zlib UNAVAILABLE') |
| 577 | raise ZipImportError("can't decompress data; zlib not available") |
| 578 | finally: |
| 579 | _importing_zlib = False |
| 580 | |
| 581 | _bootstrap._verbose_message('zipimport: zlib available') |
| 582 | return _zlib_decompress |
| 583 | |
| 584 | |
| 585 | _importing_zstd = False |
no test coverage detected
searching dependent graphs…