mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-23 01:46:35 +03:00
Fix MemorySession file caching
This commit is contained in:
parent
8e62f797bb
commit
52a4327769
|
@ -228,7 +228,7 @@ class MemorySession(Session):
|
||||||
def cache_file(self, md5_digest, file_size, instance):
|
def cache_file(self, md5_digest, file_size, instance):
|
||||||
if not isinstance(instance, (InputDocument, InputPhoto)):
|
if not isinstance(instance, (InputDocument, InputPhoto)):
|
||||||
raise TypeError('Cannot cache %s instance' % type(instance))
|
raise TypeError('Cannot cache %s instance' % type(instance))
|
||||||
key = (md5_digest, file_size, _SentFileType.from_type(instance))
|
key = (md5_digest, file_size, _SentFileType.from_type(type(instance)))
|
||||||
value = (instance.id, instance.access_hash)
|
value = (instance.id, instance.access_hash)
|
||||||
self._files[key] = value
|
self._files[key] = value
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user