Fixed IndexError in Irc.removeCallback

This commit is contained in:
Jeremy Fincher 2003-03-27 20:38:40 +00:00
parent f1823ef5f5
commit 7d44088223

View File

@ -280,7 +280,7 @@ class Irc(object):
toRemove.append(i)
if toRemove:
for i in reviter(range(len(self.callbacks))):
if toRemove[-1] == i:
if toRemove and toRemove[-1] == i:
toRemove.pop()
ret.append(self.callbacks.pop(i))
return ret