api: do not fail events when listener is cancelled in the meantime

Raising any error from event handler will abort further handlers of this
event.
This commit is contained in:
Marek Marczykowski-Górecki 2017-08-30 12:52:21 +02:00
parent a3f542edcd
commit 8c1ba905a0
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -325,6 +325,8 @@ class QubesDaemonProtocol(asyncio.Protocol):
self.transport.write(content.encode('utf-8'))
def send_event(self, subject, event, **kwargs):
if self.transport is None:
return
self.event_sent = True
self.send_header(0x31)