From 0d9d5032efe509bbe80eaa01bed8c80d98b9ffbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannes=20H=C3=B6ke?= Date: Mon, 18 Apr 2016 19:21:57 +0200 Subject: [PATCH] exit immediately if receiving second interrupt #224 --- telegram/ext/updater.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/telegram/ext/updater.py b/telegram/ext/updater.py index 1cb47eea0..cdfc64e2f 100644 --- a/telegram/ext/updater.py +++ b/telegram/ext/updater.py @@ -388,7 +388,12 @@ class Updater(object): def signal_handler(self, signum, frame): self.is_idle = False - self.stop() + if self.running: + self.stop() + else: + self.logger.warning('Exiting immediately!') + import os + os._exit(1) def idle(self, stop_signals=(SIGINT, SIGTERM, SIGABRT)): """