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

Function _get_zlib_decompress_func

Lib/zipimport.py:560–582  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

558# be imported. The function is cached when found, so subsequent calls
559# don't import zlib again.
560def _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

Callers 1

_get_dataFunction · 0.85

Calls 1

ZipImportErrorClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…