mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 09:26:37 +03:00
Return marked ID from MemorySession.get_entity_rows_by_id (#4177)
Otherwise the unpacking done later won't work.
This commit is contained in:
parent
b0f9fd1f25
commit
e617b59d48
|
@ -174,7 +174,7 @@ class MemorySession(Session):
|
||||||
def get_entity_rows_by_id(self, id, exact=True):
|
def get_entity_rows_by_id(self, id, exact=True):
|
||||||
try:
|
try:
|
||||||
if exact:
|
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)
|
in self._entities if found_id == id)
|
||||||
else:
|
else:
|
||||||
ids = (
|
ids = (
|
||||||
|
@ -182,7 +182,7 @@ class MemorySession(Session):
|
||||||
utils.get_peer_id(PeerChat(id)),
|
utils.get_peer_id(PeerChat(id)),
|
||||||
utils.get_peer_id(PeerChannel(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)
|
in self._entities if found_id in ids)
|
||||||
except StopIteration:
|
except StopIteration:
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in New Issue
Block a user