diff --git a/dr_botzo/ircbot/bot.py b/dr_botzo/ircbot/bot.py index 5c0edec..bd4eb89 100644 --- a/dr_botzo/ircbot/bot.py +++ b/dr_botzo/ircbot/bot.py @@ -412,6 +412,13 @@ class IRCBot(irc.client.SimpleIRCClient): except ImportError 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)) + 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))