Skip to content

Commit

Permalink
Print log message to stderr instead of stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
wkentaro committed Jan 20, 2024
1 parent 206b14c commit d57815a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gdown/cached_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ def assert_md5sum(filename, md5, quiet=False, blocksize=None):
raise ValueError("MD5 must be 32 chars: {}".format(md5))

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

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

raise AssertionError(
Expand Down Expand Up @@ -83,7 +83,7 @@ def cached_download(
# check existence
if osp.exists(path) and not md5:
if not quiet:
print("File exists: {}".format(path))
print("File exists: {}".format(path), file=sys.stderr)
return path
elif osp.exists(path) and md5:
try:
Expand Down

0 comments on commit d57815a

Please sign in to comment.