Fix creating default event loop on Python 3.14+

Closes #9107
This commit is contained in:
Zephyr Lykos 2025-10-13 20:09:54 +08:00
parent 220099a3ed
commit 831c59996f
No known key found for this signature in database
GPG key ID: D3E9D31E2F77F04D

View file

@ -227,7 +227,10 @@ def __init__(
self.asyncio_loop: asyncio.AbstractEventLoop = asyncio.SelectorEventLoop(selectors.SelectSelector())
asyncio.set_event_loop(self.asyncio_loop)
else:
try:
self.asyncio_loop = asyncio.get_event_loop()
except RuntimeError:
self.asyncio_loop = asyncio.new_event_loop()
self.return_code = 0
self.overlay_ready_reported = False
self.optional_actions = optional_actions