ircbot: handle more plugin load failures
possibly handle them a bit more cleanly, too, by deleting sys.modules entries
This commit is contained in:
parent
e7839606ec
commit
bf68099f2f
@ -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))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user