Add multiprocessing.popen_spawn_win32 submodule (#8428)

This commit is contained in:
Kevin Kirsche
2022-07-29 11:02:15 -04:00
committed by GitHub
parent 17e3cf99a4
commit f550c24886
4 changed files with 40 additions and 2 deletions

View File

@@ -0,0 +1,30 @@
import sys
from multiprocessing.process import BaseProcess
from typing import ClassVar
from .util import Finalize
if sys.platform == "win32":
__all__ = ["Popen"]
TERMINATE: int
WINEXE: bool
WINSERVICE: bool
WINENV: bool
class Popen:
finalizer: Finalize
method: ClassVar[str]
pid: int
returncode: int | None
sentinel: int
def __init__(self, process_obj: BaseProcess) -> None: ...
def duplicate_for_child(self, handle: int) -> int: ...
def wait(self, timeout: float | None = ...) -> int | None: ...
def poll(self) -> int | None: ...
def terminate(self) -> None: ...
kill = terminate
def close(self) -> None: ...

View File

@@ -27,9 +27,11 @@ def dump(obj, file, protocol: Any | None = ...) -> None: ...
if sys.platform == "win32":
if sys.version_info >= (3, 8):
def duplicate(handle, target_process: Any | None = ..., inheritable: bool = ..., *, source_process: Any | None = ...): ...
def duplicate(
handle: int, target_process: int | None = ..., inheritable: bool = ..., *, source_process: int | None = ...
) -> int: ...
else:
def duplicate(handle, target_process: Any | None = ..., inheritable: bool = ...): ...
def duplicate(handle: int, target_process: int | None = ..., inheritable: bool = ...) -> int: ...
def steal_handle(source_pid, handle): ...
def send_handle(conn, handle, destination_pid) -> None: ...

View File

@@ -48,6 +48,9 @@ winsound
ossaudiodev
spwd
# multiprocessing.popen_spawn_win32 exists on Darwin but fail to import
multiprocessing.popen_spawn_win32
# Platform differences that cannot be captured by the type system
os.SCHED_[A-Z_]+
posix.SCHED_[A-Z_]+

View File

@@ -37,6 +37,9 @@ msvcrt
winreg
winsound
# multiprocessing.popen_spawn_win32 exists on Linux but fail to import
multiprocessing.popen_spawn_win32
# Aliases for OSError
posix.error.characters_written
resource.error.characters_written