aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar jesopo2019-10-25 14:31:09 +0100
committerGravatar jesopo2019-10-25 14:31:09 +0100
commit877287291ae395cfe0c61994a9c44d38adfe211f (patch)
tree78194e756d80fc401273ee97f3902ae9db9c411b /src
parentremove bot.panic() `throw` kwarg (diff)
signature
`reason` arg of `panic()` shouldn't be optional, detect current exception
Diffstat (limited to 'src')
-rw-r--r--src/IRCBot.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/IRCBot.py b/src/IRCBot.py
index 1103dd9c..bd00b0d6 100644
--- a/src/IRCBot.py
+++ b/src/IRCBot.py
@@ -137,12 +137,12 @@ class Bot(object):
elif type == TriggerResult.Return:
return returned
- def panic(self, reason=None):
- callback = None
-
- if not reason == None:
- self.log.critical("panic() called: %s", [reason], exc_info=True)
+ def panic(self, reason):
+ exc_info = False
+ if any(sys.exc_info()):
+ exc_info = True
+ self.log.critical("panic() called: %s", [reason], exc_info=exc_info)
sys.exit(20)
def _module_lists(self):