Skip to content

Commit

Permalink
fix missed hash -> hash_file name change
Browse files Browse the repository at this point in the history
  • Loading branch information
bencevans committed Apr 25, 2022
1 parent 624b987 commit db91e9e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions camtrapml/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def download(url: str, path: Path, md5_hash: str) -> None:
Downloads a file from a URL to a path.
"""

if path.exists() and (md5_hash == "" or md5_hash == hash(path)):
if path.exists() and (md5_hash == "" or md5_hash == hash_file(path)):
return

path.parent.mkdir(parents=True, exist_ok=True)
Expand All @@ -35,7 +35,7 @@ def download(url: str, path: Path, md5_hash: str) -> None:
progress_bar.update(size)

if md5_hash != "":
assert md5_hash == hash(path)
assert md5_hash == hash_file(path)


def hash_file(path: Path) -> str:
Expand Down

0 comments on commit db91e9e

Please sign in to comment.