Update downloads.py

This commit is contained in:
Lonami 2019-07-09 11:39:29 +02:00 committed by GitHub
parent ee93be9422
commit f676005de5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -439,7 +439,8 @@ class DownloadMethods:
if inspect.isawaitable(r): if inspect.isawaitable(r):
await r await r
if hasattr(f, 'flush') and callable(getattr(f, 'flush')): # Not all IO objects have flush (see #1227)
if callable(getattr(f, 'flush', None)):
f.flush() f.flush()
if in_memory: if in_memory: