mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-04 12:10:21 +03:00
Fix modifying stripped sizes in place
This commit is contained in:
parent
b51a280dc9
commit
3e326af8ea
|
@ -342,10 +342,11 @@ class DownloadMethods(UserMethods):
|
|||
f = open(file, 'wb')
|
||||
else:
|
||||
f = file
|
||||
if isinstance(size, types.PhotoStrippedSize):
|
||||
size.bytes = utils.stripped_to_photo(size.bytes)
|
||||
|
||||
try:
|
||||
f.write(size.bytes)
|
||||
f.write(utils.stripped_photo_to_jpg(size.bytes)
|
||||
if isinstance(size, types.PhotoStrippedSize)
|
||||
else size.bytes)
|
||||
finally:
|
||||
if isinstance(file, str):
|
||||
f.close()
|
||||
|
|
Loading…
Reference in New Issue
Block a user