From 027f843047cc9766c9498d4c66f4d17efe801cc6 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Mon, 19 Feb 2018 13:43:16 +0100 Subject: [PATCH] Fix deadlock in case the message doesn't contain any media --- pyrogram/client/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index 6dabd1f4..4329672a 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -320,10 +320,10 @@ class Client: pass os.renames("./{}".format(tmp_file_name), "./downloads/{}".format(file_name)) - - done.set() except Exception as e: log.error(e, exc_info=True) + finally: + done.set() log.debug("{} stopped".format(name))