From dde196d8e4ac46331a3f646b5eaf84b38770175b Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Thu, 5 Oct 2017 13:34:44 +0200 Subject: [PATCH] Swallow errors when processing entities Some bug was causing an infinite lock due to the entity database failing with InputPeerSelf, since adding a full entity to the database wasn't disallowing self, and so wasn't utils get_peer_id. Although last commit fixed that, just in case, swallow errors there. --- telethon/tl/session.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/telethon/tl/session.py b/telethon/tl/session.py index 2b691ad7..98ffda16 100644 --- a/telethon/tl/session.py +++ b/telethon/tl/session.py @@ -181,5 +181,8 @@ class Session: self.time_offset = correct - now def process_entities(self, tlobject): - if self.entities.process(tlobject): - self.save() # Save if any new entities got added + try: + if self.entities.process(tlobject): + self.save() # Save if any new entities got added + except: + pass