mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
Update asyncio subprocess optional **kwargs (#9177)
This commit is contained in:
@@ -2,7 +2,7 @@ import subprocess
|
||||
import sys
|
||||
from _typeshed import StrOrBytesPath
|
||||
from asyncio import events, protocols, streams, transports
|
||||
from collections.abc import Callable
|
||||
from collections.abc import Callable, Collection
|
||||
from typing import IO, Any
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
|
||||
@@ -40,7 +40,7 @@ class Process:
|
||||
def kill(self) -> None: ...
|
||||
async def communicate(self, input: bytes | bytearray | memoryview | None = ...) -> tuple[bytes, bytes]: ...
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
if sys.version_info >= (3, 11):
|
||||
async def create_subprocess_shell(
|
||||
cmd: str | bytes,
|
||||
stdin: int | IO[Any] | None = ...,
|
||||
@@ -65,7 +65,13 @@ if sys.version_info >= (3, 10):
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
pass_fds: Collection[int] = ...,
|
||||
group: None | str | int = ...,
|
||||
extra_groups: None | Collection[str | int] = ...,
|
||||
user: None | str | int = ...,
|
||||
umask: int = ...,
|
||||
process_group: int | None = ...,
|
||||
pipesize: int = ...,
|
||||
) -> Process: ...
|
||||
async def create_subprocess_exec(
|
||||
program: _ExecArg,
|
||||
@@ -91,10 +97,80 @@ if sys.version_info >= (3, 10):
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
pass_fds: Collection[int] = ...,
|
||||
group: None | str | int = ...,
|
||||
extra_groups: None | Collection[str | int] = ...,
|
||||
user: None | str | int = ...,
|
||||
umask: int = ...,
|
||||
process_group: int | None = ...,
|
||||
pipesize: int = ...,
|
||||
) -> Process: ...
|
||||
|
||||
else:
|
||||
elif sys.version_info >= (3, 10):
|
||||
async def create_subprocess_shell(
|
||||
cmd: str | bytes,
|
||||
stdin: int | IO[Any] | None = ...,
|
||||
stdout: int | IO[Any] | None = ...,
|
||||
stderr: int | IO[Any] | None = ...,
|
||||
limit: int = ...,
|
||||
*,
|
||||
# These parameters are forced to these values by BaseEventLoop.subprocess_shell
|
||||
universal_newlines: Literal[False] = ...,
|
||||
shell: Literal[True] = ...,
|
||||
bufsize: Literal[0] = ...,
|
||||
encoding: None = ...,
|
||||
errors: None = ...,
|
||||
text: Literal[False, None] = ...,
|
||||
# These parameters are taken by subprocess.Popen, which this ultimately delegates to
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: subprocess._ENV | None = ...,
|
||||
startupinfo: Any | None = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Collection[int] = ...,
|
||||
group: None | str | int = ...,
|
||||
extra_groups: None | Collection[str | int] = ...,
|
||||
user: None | str | int = ...,
|
||||
umask: int = ...,
|
||||
pipesize: int = ...,
|
||||
) -> Process: ...
|
||||
async def create_subprocess_exec(
|
||||
program: _ExecArg,
|
||||
*args: _ExecArg,
|
||||
stdin: int | IO[Any] | None = ...,
|
||||
stdout: int | IO[Any] | None = ...,
|
||||
stderr: int | IO[Any] | None = ...,
|
||||
limit: int = ...,
|
||||
# These parameters are forced to these values by BaseEventLoop.subprocess_shell
|
||||
universal_newlines: Literal[False] = ...,
|
||||
shell: Literal[True] = ...,
|
||||
bufsize: Literal[0] = ...,
|
||||
encoding: None = ...,
|
||||
errors: None = ...,
|
||||
# These parameters are taken by subprocess.Popen, which this ultimately delegates to
|
||||
text: bool | None = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: subprocess._ENV | None = ...,
|
||||
startupinfo: Any | None = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Collection[int] = ...,
|
||||
group: None | str | int = ...,
|
||||
extra_groups: None | Collection[str | int] = ...,
|
||||
user: None | str | int = ...,
|
||||
umask: int = ...,
|
||||
pipesize: int = ...,
|
||||
) -> Process: ...
|
||||
|
||||
else: # >= 3.9
|
||||
async def create_subprocess_shell(
|
||||
cmd: str | bytes,
|
||||
stdin: int | IO[Any] | None = ...,
|
||||
@@ -120,7 +196,11 @@ else:
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
pass_fds: Collection[int] = ...,
|
||||
group: None | str | int = ...,
|
||||
extra_groups: None | Collection[str | int] = ...,
|
||||
user: None | str | int = ...,
|
||||
umask: int = ...,
|
||||
) -> Process: ...
|
||||
async def create_subprocess_exec(
|
||||
program: _ExecArg,
|
||||
@@ -147,5 +227,9 @@ else:
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
pass_fds: Collection[int] = ...,
|
||||
group: None | str | int = ...,
|
||||
extra_groups: None | Collection[str | int] = ...,
|
||||
user: None | str | int = ...,
|
||||
umask: int = ...,
|
||||
) -> Process: ...
|
||||
|
||||
Reference in New Issue
Block a user