Commit 1207c81a authored by louiz’'s avatar louiz’

Do not copy the stanza before calling each handler

parent 565da65c
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment