mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-03 21:24:35 +03:00
Use flush() only if it exists (#1227)
This commit is contained in:
parent
0ced884aa3
commit
c4c263a85b
|
@ -439,7 +439,10 @@ class DownloadMethods:
|
|||
if inspect.isawaitable(r):
|
||||
await r
|
||||
|
||||
f.flush()
|
||||
# Not all IO objects have flush (see #1227)
|
||||
if callable(getattr(f, 'flush', None)):
|
||||
f.flush()
|
||||
|
||||
if in_memory:
|
||||
return f.getvalue()
|
||||
finally:
|
||||
|
|
Loading…
Reference in New Issue
Block a user