Skip to content

Commit

Permalink
Update conda_build/source.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kenodegard authored Feb 26, 2024
1 parent f84a66a commit ba87925
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions conda_build/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ def download_to_cache(cache_folder, recipe_path, source_dict, verbose=False):

hashed = None

for tp in set(source_dict).intersection(ACCEPTED_HASH_TYPES):
expected_hash = source_dict[tp]
hashed = hashsum_file(path, tp)
for hash_type in set(source_dict).intersection(ACCEPTED_HASH_TYPES):
expected_hash = source_dict[hash_type]
hashed = hashsum_file(path, hash_type)
if expected_hash != hashed:
rm_rf(path)
raise RuntimeError(
f"{tp.upper()} mismatch: '{hashed}' != '{expected_hash}'"
f"{hash_type.upper()} mismatch: '{hashed}' != '{expected_hash}'"
)

# this is really a fallback. If people don't provide the hash, we still need to prevent
Expand Down

0 comments on commit ba87925

Please sign in to comment.