From 4259738864bfcd6db2a0a4dd28fe0e7d4c326608 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 16 Nov 2020 00:16:09 -0500 Subject: [PATCH] Flip to using the `trio` spawner on windows Was able to try it manually on a windows 10 system and the debugger works great! --- tractor/_spawn.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tractor/_spawn.py b/tractor/_spawn.py index ae1c708..0d43b1a 100644 --- a/tractor/_spawn.py +++ b/tractor/_spawn.py @@ -38,18 +38,17 @@ log = get_logger('tractor') # placeholder for an mp start context if so using that backend _ctx: Optional[mp.context.BaseContext] = None -_spawn_method: str = "spawn" +_spawn_method: str = "trio" if platform.system() == 'Windows': - _spawn_method = "spawn" + _ctx = mp.get_context("spawn") async def proc_waiter(proc: mp.Process) -> None: await trio.lowlevel.WaitForSingleObject(proc.sentinel) else: - # *NIX systems use ``trio`` primitives as our default - _spawn_method = "trio" + # *NIX systems use ``trio`` primitives as our default as well async def proc_waiter(proc: mp.Process) -> None: await trio.lowlevel.wait_readable(proc.sentinel)