From 7507e269ec2f769e4f6cc208dec51f69c62558e9 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 14 Jun 2023 15:32:15 -0400 Subject: [PATCH] Just import `mp` top level in `._spawn` --- tractor/_spawn.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tractor/_spawn.py b/tractor/_spawn.py index b1a20f4..db46542 100644 --- a/tractor/_spawn.py +++ b/tractor/_spawn.py @@ -19,6 +19,7 @@ Machinery for actor process spawning using multiple backends. """ from __future__ import annotations +import multiprocessing as mp import sys import platform from typing import ( @@ -53,7 +54,6 @@ from ._exceptions import ActorFailure if TYPE_CHECKING: from ._supervise import ActorNursery - import multiprocessing as mp ProcessType = TypeVar('ProcessType', mp.Process, trio.Process) log = get_logger('tractor') @@ -70,7 +70,6 @@ _spawn_method: SpawnMethodKey = 'trio' if platform.system() == 'Windows': - import multiprocessing as mp _ctx = mp.get_context("spawn") async def proc_waiter(proc: mp.Process) -> None: