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) name = getArgs(args)
callbacks = irc.removeCallback(name) callbacks = irc.removeCallback(name)
if callbacks: if callbacks:
for callback in callbacks:
callback.die()
try: try:
moduleInfo = imp.find_module(name) moduleInfo = imp.find_module(name)
module = imp.load_module(name, *moduleInfo) module = imp.load_module(name, *moduleInfo)
callback = module.Class() callback = module.Class()
irc.addCallback(callback) irc.addCallback(callback)
for callback in callbacks:
callback.die()
irc.reply(msg, conf.replySuccess) irc.reply(msg, conf.replySuccess)
except ImportError: except ImportError:
for callback in callbacks: for callback in callbacks: