File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717from __future__ import annotations
1818
1919__lazy_modules__ = {
20- "asyncio" ,
2120 "importlib" ,
2221 "importlib.metadata" ,
2322 "nox._options" ,
3736 "urllib.parse" ,
3837}
3938
40- import asyncio
4139import importlib .metadata
4240import os
4341import shutil
@@ -318,7 +316,6 @@ def _main(*, main_ep: bool) -> None:
318316 )
319317
320318 nox .registry .reset ()
321- asyncio .set_event_loop (asyncio .new_event_loop ())
322319 exit_code = execute_workflow (args )
323320
324321 # Done; exit.
Original file line number Diff line number Diff line change @@ -170,11 +170,10 @@ class _TeeSubprocess:
170170 def __init__ (
171171 self ,
172172 * ,
173- loop : asyncio .AbstractEventLoop ,
174173 interrupt_timeout : float | None ,
175174 terminate_timeout : float | None ,
176175 ) -> None :
177- self .loop = loop
176+ self .loop = asyncio . new_event_loop ()
178177 self .stdout : list [bytes ] = []
179178 self .stderr : list [bytes ] = []
180179 self .interrupt_timeout = interrupt_timeout
@@ -353,6 +352,7 @@ def handle_sigint() -> None:
353352 )
354353 finally :
355354 self .loop .remove_signal_handler (signal .SIGINT )
355+ self .loop .close ()
356356 sys .stdout .flush ()
357357 if is_canceled :
358358 raise KeyboardInterrupt
@@ -371,9 +371,7 @@ def tee_popen(
371371 Return a tuple ``(return_code, stdout, stderr)``.
372372 Standard output and standard error are also printed to ``sys.stdout``.
373373 """
374- loop = asyncio .get_event_loop ()
375374 teesub = _TeeSubprocess (
376- loop = loop ,
377375 interrupt_timeout = interrupt_timeout ,
378376 terminate_timeout = terminate_timeout ,
379377 )
You can’t perform that action at this time.
0 commit comments