diff options
-rw-r--r-- | slixmpp/xmlstream/xmlstream.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/slixmpp/xmlstream/xmlstream.py b/slixmpp/xmlstream/xmlstream.py index 8552dc6b..838f3649 100644 --- a/slixmpp/xmlstream/xmlstream.py +++ b/slixmpp/xmlstream/xmlstream.py @@ -650,11 +650,9 @@ class XMLStream(object): # remove it now instead of waiting for it to be # processed in the queue. try: - h_index = self.__event_handlers[name].index(handler) - except: + self.__event_handlers[name].remove(handler) + except ValueError: pass - else: - self.__event_handlers[name].pop(h_index) def schedule(self, name, seconds, callback, args=tuple(), kwargs={}, repeat=False): |