Skip to content

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
reasonablytall committed Jul 10, 2018
1 parent acdcb14 commit a0356bd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion autodqm/dqm.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ def _stream_file(cert, url, dest, chunk_size=4096):
Returns a generator of StreamProg tuples to indicate download progress."""
res = requests.get(url, cert=cert, stream=True)
total = res.headers.get('content-length')
if not res:
raise error("Failed to download file: {}".format(url))
total = int(res.headers.get('content-length'))
cur = 0
with open(dest, 'wb') as f:
for data in res.iter_content(chunk_size=chunk_size):
Expand Down

0 comments on commit a0356bd

Please sign in to comment.