From 52a4327769d50f15e73b0f871df0cb1d676a6f3b Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Wed, 22 Aug 2018 16:21:22 +0200 Subject: [PATCH] Fix MemorySession file caching --- telethon/sessions/memory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telethon/sessions/memory.py b/telethon/sessions/memory.py index 2bc973aa..c18bf51d 100644 --- a/telethon/sessions/memory.py +++ b/telethon/sessions/memory.py @@ -228,7 +228,7 @@ class MemorySession(Session): def cache_file(self, md5_digest, file_size, instance): if not isinstance(instance, (InputDocument, InputPhoto)): 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) self._files[key] = value