From b4a09497b865400d9c411d0bb7b6538c663d98e1 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Sun, 10 Jan 2021 15:37:10 +0100 Subject: [PATCH] Catch KeyboardInterrupt cleanly --- xbotlib.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xbotlib.py b/xbotlib.py index cb6faee..d4088cc 100644 --- a/xbotlib.py +++ b/xbotlib.py @@ -99,7 +99,11 @@ class Bot(ClientXMPP): def run(self): """Run the bot.""" self.connect() - self.process() + + try: + self.process() + except KeyboardInterrupt: + pass def reply(self, to, body, type="chat"): """Send a message."""