Skip to content

Commit 30560bb

Browse files
authored
Fix extracting wheel downloads (#444)
1 parent 030769b commit 30560bb

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

noxfile.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,9 @@ def download_url(values):
8080
for value in values:
8181
with url_lib.urlopen(value["url"]) as response:
8282
data = response.read()
83-
hash_algorithm, hash_value = [
84-
(key, value) for key, value in value["hash"].items()
85-
][0]
86-
if hashlib.new(hash_algorithm, data).hexdigest() != hash_value:
87-
raise ValueError(
88-
"Failed hash verification for {}.".format(value["url"])
89-
)
83+
name, digest = next(iter(value["hash"].items()))
84+
if hashlib.new(name, data).hexdigest() != digest:
85+
raise ValueError(f"Failed hash verification for {value['url']}.")
9086

9187
print("Download: ", value["url"])
9288
with zipfile.ZipFile(io.BytesIO(data), "r") as wheel:

0 commit comments

Comments
 (0)