diff --git a/pyrogram/session/session.py b/pyrogram/session/session.py index b5f69081..3dbedef4 100644 --- a/pyrogram/session/session.py +++ b/pyrogram/session/session.py @@ -382,8 +382,8 @@ class Session: await asyncio.wait_for(self.results[msg_id].event.wait(), timeout) except asyncio.TimeoutError: pass - - result = self.results.pop(msg_id).value + finally: + result = self.results.pop(msg_id).value if result is None: raise TimeoutError