File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -438,9 +438,9 @@ def aiotrio_run(
438
438
pass_not_threadsafe : bool = True ,
439
439
** start_guest_run_kwargs : Any ,
440
440
) -> T :
441
- loop = asyncio .new_event_loop ()
442
441
443
442
async def aio_main () -> T :
443
+ loop = asyncio .get_running_loop ()
444
444
trio_done_fut : asyncio .Future [Outcome [T ]] = loop .create_future ()
445
445
446
446
def trio_done_callback (main_outcome : Outcome [T ]) -> None :
@@ -459,12 +459,7 @@ def trio_done_callback(main_outcome: Outcome[T]) -> None:
459
459
460
460
return (await trio_done_fut ).unwrap ()
461
461
462
- try :
463
- # can't use asyncio.run because that fails on Windows (3.8, x64, with
464
- # Komodia LSP)
465
- return loop .run_until_complete (aio_main ())
466
- finally :
467
- loop .close ()
462
+ return asyncio .run (aio_main ())
468
463
469
464
470
465
def test_guest_mode_on_asyncio () -> None :
You can’t perform that action at this time.
0 commit comments