Skip to content

Commit 5f4e449

Browse files
committed
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
1 parent 31d257c commit 5f4e449

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

qubes_menu/appmenu.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,8 @@ def main():
550550
dispatcher = qubesadmin.events.EventsDispatcher(qapp)
551551
app = AppMenu(qapp, dispatcher)
552552
if HAS_GBULB:
553-
loop: gbulb.GLibEventLoop = asyncio.get_event_loop()
553+
loop: gbulb.GLibEventLoop = asyncio.new_event_loop()
554+
asyncio.set_event_loop(loop)
554555
loop.run_forever(application=app, argv=sys.argv)
555556
else:
556557
app.run(sys.argv)

qubes_menu/desktop_file_manager.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,8 @@ def _initialize_watchers(self):
308308
pyinotify.IN_MODIFY | pyinotify.IN_MOVED_FROM | \
309309
pyinotify.IN_MOVED_TO
310310

311-
loop = asyncio.get_event_loop()
311+
loop = asyncio.new_event_loop()
312+
asyncio.set_event_loop(loop)
312313

313314
self.notifier = pyinotify.AsyncioNotifier(
314315
self.watch_manager, loop,

0 commit comments

Comments
 (0)