From 40b768e97cde2af0e5864ca36220b93351e43b42 Mon Sep 17 00:00:00 2001 From: Eric Blundell Date: Sat, 21 Apr 2018 13:50:30 -0500 Subject: [PATCH] Make Client.signal_handler reentrant (#57) --- pyrogram/client/client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index d3a5850f..dc24b6ae 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -810,7 +810,6 @@ class Client: log.debug("{} stopped".format(name)) def signal_handler(self, *args): - self.stop() self.is_idle = False def idle(self, stop_signals: tuple = (SIGINT, SIGTERM, SIGABRT)): @@ -830,6 +829,8 @@ class Client: while self.is_idle: time.sleep(1) + self.stop() + def send(self, data: Object): """Use this method to send Raw Function queries.