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

Function check_shasum

Platforms/emscripten/__main__.py:293–297  ·  view source on GitHub ↗
(file: str, expected_shasum: str)

Source from the content-addressed store, hash-verified

291
292
293def check_shasum(file: str, expected_shasum: str):
294 with open(file, "rb") as f:
295 digest = hashlib.file_digest(f, "sha256")
296 if digest.hexdigest() != expected_shasum:
297 raise RuntimeError(f"Unexpected shasum for {file}")
298
299
300def download_and_unpack(working_dir: Path, url: str, expected_shasum: str):

Callers 1

download_and_unpackFunction · 0.85

Calls 2

hexdigestMethod · 0.80
openFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…