File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -110,10 +110,13 @@ def main():
110110 if not os .path .exists ('/var/run/qubes-service/shutdown-idle' ):
111111 return
112112
113+ # Initialize event loop for Python 3.14 compatibility
114+ asyncio .set_event_loop (asyncio .new_event_loop ())
115+
113116 monitor = IdlenessMonitor ()
114117 monitor .load_watchers ()
115118
116- asyncio .get_event_loop (). run_until_complete (monitor .monitor_idleness ())
119+ asyncio .run (monitor .monitor_idleness ())
117120
118121 subprocess .call (['sudo' , 'poweroff' ])
119122
Original file line number Diff line number Diff line change @@ -76,6 +76,8 @@ def is_idle(self):
7676
7777class MonitorTest (unittest .IsolatedAsyncioTestCase ):
7878 def setUp (self ):
79+ # Initialize event loop for Python 3.14 compatibility
80+ asyncio .set_event_loop (asyncio .new_event_loop ())
7981 idleness_monitor .TIMEOUT_SECONDS = LOOP_TIMEOUT
8082 self .monitor = idleness_monitor .IdlenessMonitor ()
8183
You can’t perform that action at this time.
0 commit comments