Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify the message printed by assert_md5sum function. #298

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions gdown/cached_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,11 @@ def assert_md5sum(filename, md5, quiet=False, blocksize=None):
if not (isinstance(md5, str) and len(md5) == 32):
raise ValueError("MD5 must be 32 chars: {}".format(md5))

if not quiet:
print("Computing MD5: {}".format(filename), file=sys.stderr)
md5_actual = md5sum(filename)

if md5_actual == md5:
if not quiet:
print("MD5 matches: {}".format(filename), file=sys.stderr)
print(f"MD5 matches: {filename!r} == {md5!r}", file=sys.stderr)
return True

raise AssertionError(
Expand Down