mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Simplify multiprocessing.context.{SpawnProcess,SpawnContext} (#8499)
This commit is contained in:
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user