xmlstream: fix race conditions on handlers

This commit is contained in:
mathieui 2021-01-25 09:56:53 +01:00
parent 0eed84d0b2
commit efdcd396d8

View file

@ -833,7 +833,7 @@ class XMLStream(asyncio.BaseProtocol):
"""
log.debug("Event triggered: %s", name)
handlers = self.__event_handlers.get(name, [])
handlers = self.__event_handlers.get(name, [])[:]
for handler in handlers:
handler_callback, disposable = handler
old_exception = getattr(data, 'exception', None)