summaryrefslogtreecommitdiff
path: root/sleekxmpp/xmlstream/xmlstream.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2010-10-07 09:17:28 -0400
committerLance Stout <lancestout@gmail.com>2010-10-07 09:17:28 -0400
commit78141fe5f3d3e8267b6969690b93dd7aba41cf65 (patch)
tree559b696bc89df6c56e5220617e2a6d4366debd9b /sleekxmpp/xmlstream/xmlstream.py
parent88d21d210c15d76000b6a3c69e47a55b1582d054 (diff)
downloadslixmpp-78141fe5f3d3e8267b6969690b93dd7aba41cf65.tar.gz
slixmpp-78141fe5f3d3e8267b6969690b93dd7aba41cf65.tar.bz2
slixmpp-78141fe5f3d3e8267b6969690b93dd7aba41cf65.tar.xz
slixmpp-78141fe5f3d3e8267b6969690b93dd7aba41cf65.zip
Fixed dealing with deleting handlers.
The call to .index() may raise a ValueError if the item is not in the list. So both the .index() and .pop() calls should be in the try block.
Diffstat (limited to 'sleekxmpp/xmlstream/xmlstream.py')
-rw-r--r--sleekxmpp/xmlstream/xmlstream.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py
index b7382c82..60adfb2a 100644
--- a/sleekxmpp/xmlstream/xmlstream.py
+++ b/sleekxmpp/xmlstream/xmlstream.py
@@ -492,8 +492,8 @@ class XMLStream(object):
# remove it now instead of waiting for it to be
# processed in the queue.
with self.__event_handlers_lock:
- handler_index = self.__event_handlers[name].index(handler)
try:
+ handler_index = self.__event_handlers[name].index(handler)
self.__event_handlers[name].pop(handler_index)
except:
pass