Initialize asyncio event loop before using it

Python 3.14 (in Fedora 43) throws RunetimeError if event loop is not
initialized before using it.

Resolves: QubesOS/qubes-issues#10188
This commit is contained in:
Ali Mirjamali 2025-08-27 21:34:24 +03:30
parent d05bb2b25b
commit bb5054c462
No known key found for this signature in database
GPG key ID: B4A5C188DF4FAB67

View file

@ -222,9 +222,7 @@ Here is the server code:
socket_path = '/var/run/qubes/policy-agent.sock'
service = SocketService(socket_path)
loop = asyncio.get_event_loop()
loop.run_until_complete(service.run())
asyncio.run(service.run())
if __name__ == '__main__':
main()