3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +01:00

corecommands: actually assign reload() output to update the module

This commit is contained in:
James Lu 2016-07-11 16:53:32 -07:00
parent 6904ba9606
commit cf40a38c14

View File

@ -72,7 +72,7 @@ def load(irc, source, args):
return
log.info('(%s) Loading plugin %r for %s', irc.name, name, irc.getHostmask(source))
try:
world.plugins[name] = pl = utils.loadPlugin(name)
world.plugins[name] = pl = importlib.reload(utils.loadPlugin(name))
except ImportError as e:
if str(e) == ('No module named %r' % name):
log.exception('Failed to load plugin %r: The plugin could not be found.', name)
@ -80,7 +80,6 @@ def load(irc, source, args):
log.exception('Failed to load plugin %r: ImportError.', name)
raise
else:
importlib.reload(pl)
if hasattr(pl, 'main'):
log.debug('Calling main() function of plugin %r', pl)
pl.main(irc)