mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-11-24 03:00:15 +00:00
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.
This commit is contained in:
parent
88d21d210c
commit
78141fe5f3
1 changed files with 1 additions and 1 deletions
|
@ -492,8 +492,8 @@ class XMLStream(object):
|
||||||
# remove it now instead of waiting for it to be
|
# remove it now instead of waiting for it to be
|
||||||
# processed in the queue.
|
# processed in the queue.
|
||||||
with self.__event_handlers_lock:
|
with self.__event_handlers_lock:
|
||||||
handler_index = self.__event_handlers[name].index(handler)
|
|
||||||
try:
|
try:
|
||||||
|
handler_index = self.__event_handlers[name].index(handler)
|
||||||
self.__event_handlers[name].pop(handler_index)
|
self.__event_handlers[name].pop(handler_index)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in a new issue