Fix modifying stripped sizes in place

This commit is contained in:
Lonami 2019-04-25 20:29:54 +02:00 committed by GitHub
parent b51a280dc9
commit 3e326af8ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -342,10 +342,11 @@ class DownloadMethods(UserMethods):
f = open(file, 'wb') f = open(file, 'wb')
else: else:
f = file f = file
if isinstance(size, types.PhotoStrippedSize):
size.bytes = utils.stripped_to_photo(size.bytes)
try: try:
f.write(size.bytes) f.write(utils.stripped_photo_to_jpg(size.bytes)
if isinstance(size, types.PhotoStrippedSize)
else size.bytes)
finally: finally:
if isinstance(file, str): if isinstance(file, str):
f.close() f.close()