MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _get_decompress_func

Function _get_decompress_func

tools/python-3.11.9-amd64/Lib/zipimport.py:566–584  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

564# be imported. The function is cached when found, so subsequent calls
565# don't import zlib again.
566def _get_decompress_func():
567 global _importing_zlib
568 if _importing_zlib:
569 # Someone has a zlib.py[co] in their Zip file
570 # let's avoid a stack overflow.
571 _bootstrap._verbose_message('zipimport: zlib UNAVAILABLE')
572 raise ZipImportError("can't decompress data; zlib not available")
573
574 _importing_zlib = True
575 try:
576 from zlib import decompress
577 except Exception:
578 _bootstrap._verbose_message('zipimport: zlib UNAVAILABLE')
579 raise ZipImportError("can't decompress data; zlib not available")
580 finally:
581 _importing_zlib = False
582
583 _bootstrap._verbose_message('zipimport: zlib available')
584 return decompress
585
586# Given a path to a Zip file and a toc_entry, return the (uncompressed) data.
587def _get_data(archive, toc_entry):

Callers 1

_get_dataFunction · 0.85

Calls 1

ZipImportErrorClass · 0.85

Tested by

no test coverage detected