write requests response content more idomatically

This commit is contained in:
Nate Prewitt
2017-10-25 08:03:06 -07:00
parent 3299208507
commit e8ceb6db8e
+1 -2
View File
@@ -944,6 +944,5 @@ def download_file(url, filename):
if not r.ok:
raise IOError('Unable to download file')
r.raw.decode_content = True
with open(filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
f.write(r.content)