From 2e25a7ed04e9f0346e8854674a4dd19d2c70afad Mon Sep 17 00:00:00 2001 From: dpedu Date: Sun, 30 Aug 2015 23:23:09 -0700 Subject: [PATCH] Make sys exit optional --- pyircbot/pyircbot.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyircbot/pyircbot.py b/pyircbot/pyircbot.py index caba74f..b926f96 100644 --- a/pyircbot/pyircbot.py +++ b/pyircbot/pyircbot.py @@ -68,14 +68,15 @@ class PyIRCBot: def loop(self): self.irc.loop() - def kill(self): + def kill(self, sys_exit=True): """Shut down the bot violently""" #Close all modules self.closeAllModules() self.irc.kill() - sys.exit(0) + if sys_exit: + sys.exit(0) def connection_closed(self, args, prefix, trailing): """Called when the socket is disconnected. We will want to reconnect. """