summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2014-07-22 11:16:06 +0200
committerFlorent Le Coz <louiz@louiz.org>2014-07-22 11:16:06 +0200
commit5611b30022fbe6c2b91ffb145d604f3c07ff6898 (patch)
tree91dd5e36ea10641eeceff82229d29675bbb4546d
parentede9dcd18f81dd094e587105071d19ca35d00a3e (diff)
downloadslixmpp-5611b30022fbe6c2b91ffb145d604f3c07ff6898.tar.gz
slixmpp-5611b30022fbe6c2b91ffb145d604f3c07ff6898.tar.bz2
slixmpp-5611b30022fbe6c2b91ffb145d604f3c07ff6898.tar.xz
slixmpp-5611b30022fbe6c2b91ffb145d604f3c07ff6898.zip
Use ".remove()" instead of "is in" followed by ".pop()"
-rw-r--r--slixmpp/xmlstream/xmlstream.py6
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):