From e617b59d4819a3168c9c1e078b7f9834f8b06bfa Mon Sep 17 00:00:00 2001 From: Kacnep89 <76146578+Kacnep89@users.noreply.github.com> Date: Wed, 23 Aug 2023 19:07:32 +0500 Subject: [PATCH] Return marked ID from MemorySession.get_entity_rows_by_id (#4177) Otherwise the unpacking done later won't work. --- telethon/sessions/memory.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telethon/sessions/memory.py b/telethon/sessions/memory.py index 721b6d9a..5aed6039 100644 --- a/telethon/sessions/memory.py +++ b/telethon/sessions/memory.py @@ -174,7 +174,7 @@ class MemorySession(Session): def get_entity_rows_by_id(self, id, exact=True): try: if exact: - return next((id, hash) for found_id, hash, _, _, _ + return next((found_id, hash) for found_id, hash, _, _, _ in self._entities if found_id == id) else: ids = ( @@ -182,7 +182,7 @@ class MemorySession(Session): utils.get_peer_id(PeerChat(id)), utils.get_peer_id(PeerChannel(id)) ) - return next((id, hash) for found_id, hash, _, _, _ + return next((found_id, hash) for found_id, hash, _, _, _ in self._entities if found_id in ids) except StopIteration: pass