Skip to content

Add missing multiprocessing.popen_fork type stubs #8420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jul 28, 2022
Merged
23 changes: 23 additions & 0 deletions stdlib/multiprocessing/popen_fork.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import sys
from typing import ClassVar

from .process import BaseProcess
from .util import Finalize

if sys.platform != "win32":
__all__ = ["Popen"]

class Popen:
finalizer: Finalize | None
method: ClassVar[str]
pid: int
returncode: int | None
sentinel: int # doesn't exist if os.fork in _launch returns 0

def __init__(self, process_obj: BaseProcess) -> None: ...
def duplicate_for_child(self, fd: int) -> int: ...
def poll(self, flag: int = ...) -> int | None: ...
def wait(self, timeout: float | None = ...) -> int | None: ...
def terminate(self) -> None: ...
def kill(self) -> None: ...
def close(self) -> None: ...
3 changes: 3 additions & 0 deletions tests/stubtest_allowlists/win32.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ syslog
termios
xxlimited

# Multiprocessing.popen_fork exists on Windows but fails to import
multiprocessing.popen_fork

# Modules that rely on _curses
curses
curses.ascii
Expand Down