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

Function _get_zstd_decompressor_class

Lib/zipimport.py:590–612  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

588# Return the _zstd.ZstdDecompressor function object, or NULL if _zstd couldn't
589# be imported. The result is cached when found.
590def _get_zstd_decompressor_class():
591 global _zstd_decompressor_class
592 if _zstd_decompressor_class:
593 return _zstd_decompressor_class
594
595 global _importing_zstd
596 if _importing_zstd:
597 # Someone has a _zstd.py[co] in their Zip file
598 # let's avoid a stack overflow.
599 _bootstrap._verbose_message("zipimport: zstd UNAVAILABLE")
600 raise ZipImportError("can't decompress data; zstd not available")
601
602 _importing_zstd = True
603 try:
604 from _zstd import ZstdDecompressor as _zstd_decompressor_class
605 except Exception:
606 _bootstrap._verbose_message("zipimport: zstd UNAVAILABLE")
607 raise ZipImportError("can't decompress data; zstd not available")
608 finally:
609 _importing_zstd = False
610
611 _bootstrap._verbose_message("zipimport: zstd available")
612 return _zstd_decompressor_class
613
614
615def _zstd_decompress(data):

Callers 1

_zstd_decompressFunction · 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…