diff --git a/plugins/Owner/plugin.py b/plugins/Owner/plugin.py index 171576eb0..7230710ca 100644 --- a/plugins/Owner/plugin.py +++ b/plugins/Owner/plugin.py @@ -124,6 +124,8 @@ class Owner(callbacks.Plugin): # This plugin must be first; its priority must be lowest; otherwise odd # things will happen when adding callbacks. def __init__(self, irc=None): + if irc is not None: + assert not irc.getCallback(self.name()) self.__parent = super(Owner, self) self.__parent.__init__(irc) # Setup log object/command. @@ -254,7 +256,8 @@ class Owner(callbacks.Plugin): do422 = do377 = do376 def doPrivmsg(self, irc, msg): - assert self is irc.callbacks[0], 'Owner isn\'t first callback.' + assert self is irc.callbacks[0], \ + 'Owner isn\'t first callback: %r' % irc.callbacks if ircmsgs.isCtcp(msg): return s = callbacks.addressed(irc.nick, msg) diff --git a/src/irclib.py b/src/irclib.py index 64b521f52..cf818ac8e 100644 --- a/src/irclib.py +++ b/src/irclib.py @@ -629,6 +629,7 @@ class Irc(IrcCommandDispatcher): # This *isn't* threadsafe! def addCallback(self, callback): """Adds a callback to the callbacks list.""" + assert not self.getCallback(callback.name()) self.callbacks.append(callback) # This is the new list we're building, which will be tsorted. cbs = []