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