Check exist flush method

This commit is contained in:
Alexander Zaguzin 2019-07-09 10:35:14 +07:00
parent 0ced884aa3
commit ee93be9422

View File

@ -439,7 +439,9 @@ class DownloadMethods:
if inspect.isawaitable(r):
await r
f.flush()
if hasattr(f, 'flush') and callable(getattr(f, 'flush')):
f.flush()
if in_memory:
return f.getvalue()
finally: