MCPcopy Index your code
hub / github.com/RustPython/RustPython / _get_decompress_func

Function _get_decompress_func

Lib/zipimport.py:610–628  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

608# be imported. The function is cached when found, so subsequent calls
609# don't import zlib again.
610def _get_decompress_func():
611 global _importing_zlib
612 if _importing_zlib:
613 # Someone has a zlib.py[co] in their Zip file
614 # let's avoid a stack overflow.
615 _bootstrap._verbose_message('zipimport: zlib UNAVAILABLE')
616 raise ZipImportError("can't decompress data; zlib not available")
617
618 _importing_zlib = True
619 try:
620 from zlib import decompress
621 except Exception:
622 _bootstrap._verbose_message('zipimport: zlib UNAVAILABLE')
623 raise ZipImportError("can't decompress data; zlib not available")
624 finally:
625 _importing_zlib = False
626
627 _bootstrap._verbose_message('zipimport: zlib available')
628 return decompress
629
630# Given a path to a Zip file and a toc_entry, return the (uncompressed) data.
631def _get_data(archive, toc_entry):

Callers 1

_get_dataFunction · 0.85

Calls 1

ZipImportErrorClass · 0.85

Tested by

no test coverage detected