use request.iter_content
This commit is contained in:
parent
e850296f68
commit
6b22e2ec29
1 changed files with 1 additions and 1 deletions
|
@ -126,7 +126,7 @@ class API(object):
|
|||
tmpname = filename + '.tmp'
|
||||
with open(tmpname, 'wb') as fd:
|
||||
r = self._requests_session.get(url)
|
||||
for chunk in iter(lambda: r.read(chunk_size), b''):
|
||||
for chunk in r.iter_content(chunk_size=chunk_size):
|
||||
fd.write(chunk)
|
||||
shutil.move(tmpname, filename)
|
||||
|
||||
|
|
Loading…
Reference in a new issue