From c04f719a81c2ab28e0e9a9b7939d49d88dfcc929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Thu, 26 Jan 2023 05:16:32 +0100 Subject: [PATCH] Wrap coroutine in a task before passing to asyncio.wait QubesOS/qubes-issues#6982 --- qrexec/tools/qrexec_policy_agent.py | 2 +- qrexec/tools/qrexec_policy_daemon.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qrexec/tools/qrexec_policy_agent.py b/qrexec/tools/qrexec_policy_agent.py index 68effb21..2beecd3b 100644 --- a/qrexec/tools/qrexec_policy_agent.py +++ b/qrexec/tools/qrexec_policy_agent.py @@ -650,7 +650,7 @@ def main(): loop = asyncio.get_event_loop() tasks = [ - agent.run(), + asyncio.create_task(agent.run()), ] loop.run_until_complete(asyncio.wait(tasks)) diff --git a/qrexec/tools/qrexec_policy_daemon.py b/qrexec/tools/qrexec_policy_daemon.py index 83634e36..85ba7534 100644 --- a/qrexec/tools/qrexec_policy_daemon.py +++ b/qrexec/tools/qrexec_policy_daemon.py @@ -335,7 +335,7 @@ async def start_serving(args=None): await asyncio.wait( [ - server.serve_forever() + asyncio.create_task(server.serve_forever()) for server in (policy_server, eval_server, gui_eval_server) ] )