mirror of
https://github.com/jlu5/PyLink.git
synced 2025-06-01 12:27:33 +02:00
corecommands: quick fix for 'reload' not updating things
The real issue is the 'unload' doesn't seem to cleanly unload things anymore. (Even though that was a pretty bad hack in the first place) That needs to be cleaned up in the next release.
This commit is contained in:
parent
f97f2d2fda
commit
7a7b590295
@ -4,6 +4,7 @@ corecommands.py - Implements core PyLink commands.
|
|||||||
|
|
||||||
import gc
|
import gc
|
||||||
import sys
|
import sys
|
||||||
|
import importlib
|
||||||
|
|
||||||
from . import control
|
from . import control
|
||||||
from pylinkirc import utils, world
|
from pylinkirc import utils, world
|
||||||
@ -76,6 +77,7 @@ def load(irc, source, args):
|
|||||||
log.exception('Failed to load plugin %r: ImportError.', name)
|
log.exception('Failed to load plugin %r: ImportError.', name)
|
||||||
raise
|
raise
|
||||||
else:
|
else:
|
||||||
|
importlib.reload(pl)
|
||||||
if hasattr(pl, 'main'):
|
if hasattr(pl, 'main'):
|
||||||
log.debug('Calling main() function of plugin %r', pl)
|
log.debug('Calling main() function of plugin %r', pl)
|
||||||
pl.main(irc)
|
pl.main(irc)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user