mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-08 04:52:30 +00:00
Use flush() only if it exists (#1227)
This commit is contained in:
@@ -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:
|
||||
|
Reference in New Issue
Block a user