From 1207c81ab50f5aa2865f60cbf005839a44be015b Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Sat, 3 Jan 2015 18:42:57 +0100 Subject: Do not copy the stanza before calling each handler --- slixmpp/xmlstream/xmlstream.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/slixmpp/xmlstream/xmlstream.py b/slixmpp/xmlstream/xmlstream.py index f1abfca6..7417a7dc 100644 --- a/slixmpp/xmlstream/xmlstream.py +++ b/slixmpp/xmlstream/xmlstream.py @@ -901,15 +901,11 @@ class XMLStream(object): handled = False matched_handlers = [h for h in self.__handlers if h.match(stanza)] for handler in matched_handlers: - if len(matched_handlers) > 1: - stanza_copy = copy.copy(stanza) - else: - stanza_copy = stanza - handler.prerun(stanza_copy) + handler.prerun(stanza) try: - handler.run(stanza_copy) + handler.run(stanza) except Exception as e: - stanza_copy.exception(e) + stanza.exception(e) if handler.check_delete(): self.__handlers.remove(handler) handled = True -- cgit v1.2.3