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

Function download_and_unpack

Platforms/emscripten/__main__.py:300–308  ·  view source on GitHub ↗
(working_dir: Path, url: str, expected_shasum: str)

Source from the content-addressed store, hash-verified

298
299
300def download_and_unpack(working_dir: Path, url: str, expected_shasum: str):
301 with tempfile.NamedTemporaryFile(
302 suffix=".tar.gz", delete_on_close=False
303 ) as tmp_file:
304 with urlopen(url) as response:
305 shutil.copyfileobj(response, tmp_file)
306 tmp_file.close()
307 check_shasum(tmp_file.name, expected_shasum)
308 shutil.unpack_archive(tmp_file.name, working_dir)
309
310
311def should_build_library(prefix, name, config, quiet):

Callers 2

make_emscripten_libffiFunction · 0.85
make_mpdecFunction · 0.85

Calls 3

urlopenFunction · 0.90
check_shasumFunction · 0.85
closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…