diff --git a/stdlib/multiprocessing/context.pyi b/stdlib/multiprocessing/context.pyi index f8fa0fa64..16b7cfe9e 100644 --- a/stdlib/multiprocessing/context.pyi +++ b/stdlib/multiprocessing/context.pyi @@ -145,17 +145,25 @@ class DefaultContext(BaseContext): _default_context: DefaultContext +class SpawnProcess(BaseProcess): + _start_method: str + if sys.platform != "win32": + @staticmethod + def _Popen(process_obj: BaseProcess) -> popen_spawn_posix.Popen: ... + else: + @staticmethod + def _Popen(process_obj: BaseProcess) -> popen_spawn_win32.Popen: ... + +class SpawnContext(BaseContext): + _name: str + Process: ClassVar[type[SpawnProcess]] + if sys.platform != "win32": class ForkProcess(BaseProcess): _start_method: str @staticmethod def _Popen(process_obj: BaseProcess) -> popen_fork.Popen: ... - class SpawnProcess(BaseProcess): - _start_method: str - @staticmethod - def _Popen(process_obj: BaseProcess) -> popen_spawn_posix.Popen: ... - class ForkServerProcess(BaseProcess): _start_method: str @staticmethod @@ -165,24 +173,10 @@ if sys.platform != "win32": _name: str Process: ClassVar[type[ForkProcess]] - class SpawnContext(BaseContext): - _name: str - Process: ClassVar[type[SpawnProcess]] - class ForkServerContext(BaseContext): _name: str Process: ClassVar[type[ForkServerProcess]] -else: - class SpawnProcess(BaseProcess): - _start_method: str - @staticmethod - def _Popen(process_obj: BaseProcess) -> popen_spawn_win32.Popen: ... - - class SpawnContext(BaseContext): - _name: str - Process: ClassVar[type[SpawnProcess]] - def _force_start_method(method: str) -> None: ... def get_spawning_popen() -> Any | None: ... def set_spawning_popen(popen: Any) -> None: ...