ircbot: properly output exception msg to string

This commit is contained in:
Brian S. Stephan 2016-01-16 19:34:06 -06:00
parent 570a4e1962
commit cdde966733
1 changed files with 2 additions and 2 deletions

View File

@ -621,13 +621,13 @@ class IRCBot(irc.client.SimpleIRCClient):
log.exception(e)
# i don't think this would get populated if __import__ failed del sys.modules[plugin_path]
if feedback:
self.privmsg(dest, "Plugin '{0:s}' could not be loaded: {1:s}".format(plugin_path, e))
self.privmsg(dest, "Plugin '{0:s}' could not be loaded: {1:s}".format(plugin_path, str(e)))
except AttributeError as e:
log.error("Error loading '{0:s}'".format(plugin_path))
log.exception(e)
del sys.modules[plugin_path]
if feedback:
self.privmsg(dest, "Plugin '{0:s}' could not be loaded: {1:s}".format(plugin_path, e))
self.privmsg(dest, "Plugin '{0:s}' could not be loaded: {1:s}".format(plugin_path, str(e)))
def handle_unload(self, connection, event, match):
"""Handle IRC requests to unload a plugin."""