We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 030769b commit 30560bbCopy full SHA for 30560bb
noxfile.py
@@ -80,13 +80,9 @@ def download_url(values):
80
for value in values:
81
with url_lib.urlopen(value["url"]) as response:
82
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
- )
+ name, digest = next(iter(value["hash"].items()))
+ if hashlib.new(name, data).hexdigest() != digest:
+ raise ValueError(f"Failed hash verification for {value['url']}.")
90
91
print("Download: ", value["url"])
92
with zipfile.ZipFile(io.BytesIO(data), "r") as wheel:
0 commit comments