Made the old callbacks die before the new callbacks are loaded.

This commit is contained in:
Jeremy Fincher 2003-08-13 05:41:48 +00:00
parent 6d40bb475e
commit 622f96c8d4

View File

@ -279,13 +279,13 @@ class OwnerCommands(CapabilityCheckingPrivmsg):
name = getArgs(args)
callbacks = irc.removeCallback(name)
if callbacks:
for callback in callbacks:
callback.die()
try:
moduleInfo = imp.find_module(name)
module = imp.load_module(name, *moduleInfo)
callback = module.Class()
irc.addCallback(callback)
for callback in callbacks:
callback.die()
irc.reply(msg, conf.replySuccess)
except ImportError:
for callback in callbacks: