diff --git a/stdlib/@tests/stubtest_allowlists/darwin-py314.txt b/stdlib/@tests/stubtest_allowlists/darwin-py314.txt index 714311963..ea28afc74 100644 --- a/stdlib/@tests/stubtest_allowlists/darwin-py314.txt +++ b/stdlib/@tests/stubtest_allowlists/darwin-py314.txt @@ -2,7 +2,6 @@ # TODO: New errors in Python 3.14 that need to be fixed or moved below # ==================================================================== -_posixsubprocess.fork_exec asyncio.tools asyncio.unix_events.__all__ asyncio.unix_events.DefaultEventLoopPolicy diff --git a/stdlib/@tests/stubtest_allowlists/linux-py314.txt b/stdlib/@tests/stubtest_allowlists/linux-py314.txt index f5256fd59..d146424d3 100644 --- a/stdlib/@tests/stubtest_allowlists/linux-py314.txt +++ b/stdlib/@tests/stubtest_allowlists/linux-py314.txt @@ -2,7 +2,6 @@ # TODO: New errors in Python 3.14 that need to be fixed or moved below # ==================================================================== -_posixsubprocess.fork_exec asyncio.tools asyncio.unix_events.__all__ asyncio.unix_events.DefaultEventLoopPolicy diff --git a/stdlib/_posixsubprocess.pyi b/stdlib/_posixsubprocess.pyi index df05dcd80..dd74e316e 100644 --- a/stdlib/_posixsubprocess.pyi +++ b/stdlib/_posixsubprocess.pyi @@ -4,29 +4,56 @@ from collections.abc import Callable, Sequence from typing import SupportsIndex if sys.platform != "win32": - def fork_exec( - args: Sequence[StrOrBytesPath] | None, - executable_list: Sequence[bytes], - close_fds: bool, - pass_fds: tuple[int, ...], - cwd: str, - env: Sequence[bytes] | None, - p2cread: int, - p2cwrite: int, - c2pread: int, - c2pwrite: int, - errread: int, - errwrite: int, - errpipe_read: int, - errpipe_write: int, - restore_signals: int, - call_setsid: int, - pgid_to_set: int, - gid: SupportsIndex | None, - extra_groups: list[int] | None, - uid: SupportsIndex | None, - child_umask: int, - preexec_fn: Callable[[], None], - allow_vfork: bool, - /, - ) -> int: ... + if sys.version_info >= (3, 14): + def fork_exec( + args: Sequence[StrOrBytesPath] | None, + executable_list: Sequence[bytes], + close_fds: bool, + pass_fds: tuple[int, ...], + cwd: str, + env: Sequence[bytes] | None, + p2cread: int, + p2cwrite: int, + c2pread: int, + c2pwrite: int, + errread: int, + errwrite: int, + errpipe_read: int, + errpipe_write: int, + restore_signals: int, + call_setsid: int, + pgid_to_set: int, + gid: SupportsIndex | None, + extra_groups: list[int] | None, + uid: SupportsIndex | None, + child_umask: int, + preexec_fn: Callable[[], None], + /, + ) -> int: ... + else: + def fork_exec( + args: Sequence[StrOrBytesPath] | None, + executable_list: Sequence[bytes], + close_fds: bool, + pass_fds: tuple[int, ...], + cwd: str, + env: Sequence[bytes] | None, + p2cread: int, + p2cwrite: int, + c2pread: int, + c2pwrite: int, + errread: int, + errwrite: int, + errpipe_read: int, + errpipe_write: int, + restore_signals: bool, + call_setsid: bool, + pgid_to_set: int, + gid: SupportsIndex | None, + extra_groups: list[int] | None, + uid: SupportsIndex | None, + child_umask: int, + preexec_fn: Callable[[], None], + allow_vfork: bool, + /, + ) -> int: ...