From 2c115bb64890eb9e57ffbc0af16a32e141939d5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 17 Mar 2017 12:49:28 +0100 Subject: [PATCH] mgmt: allow functions to return None if no data is to be returned Don't force `return ''` everywhere. QubesOS/qubes-issues#2622 --- qubes/tools/qubesd.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qubes/tools/qubesd.py b/qubes/tools/qubesd.py index b72cd9ba..f91f6e5e 100644 --- a/qubes/tools/qubesd.py +++ b/qubes/tools/qubesd.py @@ -117,7 +117,8 @@ class QubesDaemonProtocol(asyncio.Protocol): def send_response(self, content): self.send_header(0x30) - self.transport.write(content.encode('utf-8')) + if content is not None: + self.transport.write(content.encode('utf-8')) def send_event(self, subject, event, **kwargs): self.send_header(0x31)