mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-25 05:11:09 +08:00
@@ -216,7 +216,7 @@ if sys.version_info >= (3, 7):
|
||||
timeout: Optional[float] = ...,
|
||||
) -> CompletedProcess[Any]: ...
|
||||
|
||||
elif sys.version_info >= (3, 6):
|
||||
else:
|
||||
# Nearly same args as Popen.__init__ except for timeout, input, and check
|
||||
@overload
|
||||
def run(
|
||||
@@ -350,82 +350,6 @@ elif sys.version_info >= (3, 6):
|
||||
timeout: Optional[float] = ...,
|
||||
) -> CompletedProcess[Any]: ...
|
||||
|
||||
else:
|
||||
# Nearly same args as Popen.__init__ except for timeout, input, and check
|
||||
@overload
|
||||
def run(
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: AnyPath = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[AnyPath] = ...,
|
||||
env: Optional[_ENV] = ...,
|
||||
*,
|
||||
universal_newlines: Literal[True],
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
# where the *real* keyword only args start
|
||||
check: bool = ...,
|
||||
input: Optional[str] = ...,
|
||||
timeout: Optional[float] = ...,
|
||||
) -> CompletedProcess[str]: ...
|
||||
@overload
|
||||
def run(
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: AnyPath = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[AnyPath] = ...,
|
||||
env: Optional[_ENV] = ...,
|
||||
universal_newlines: Literal[False] = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
check: bool = ...,
|
||||
input: Optional[bytes] = ...,
|
||||
timeout: Optional[float] = ...,
|
||||
) -> CompletedProcess[bytes]: ...
|
||||
@overload
|
||||
def run(
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: AnyPath = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[AnyPath] = ...,
|
||||
env: Optional[_ENV] = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
check: bool = ...,
|
||||
input: Optional[_TXT] = ...,
|
||||
timeout: Optional[float] = ...,
|
||||
) -> CompletedProcess[Any]: ...
|
||||
|
||||
# Same args as Popen.__init__
|
||||
def call(
|
||||
args: _CMD,
|
||||
@@ -625,8 +549,7 @@ if sys.version_info >= (3, 7):
|
||||
text: Optional[bool] = ...,
|
||||
) -> Any: ... # morally: -> _TXT
|
||||
|
||||
elif sys.version_info >= (3, 6):
|
||||
# 3.6 added encoding and errors
|
||||
else:
|
||||
@overload
|
||||
def check_output(
|
||||
args: _CMD,
|
||||
@@ -748,74 +671,6 @@ elif sys.version_info >= (3, 6):
|
||||
errors: Optional[str] = ...,
|
||||
) -> Any: ... # morally: -> _TXT
|
||||
|
||||
else:
|
||||
@overload
|
||||
def check_output(
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: AnyPath = ...,
|
||||
stdin: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[AnyPath] = ...,
|
||||
env: Optional[_ENV] = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
input: _TXT = ...,
|
||||
*,
|
||||
timeout: Optional[float] = ...,
|
||||
universal_newlines: Literal[True],
|
||||
) -> str: ...
|
||||
@overload
|
||||
def check_output(
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: AnyPath = ...,
|
||||
stdin: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[AnyPath] = ...,
|
||||
env: Optional[_ENV] = ...,
|
||||
universal_newlines: Literal[False] = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
input: _TXT = ...,
|
||||
*,
|
||||
timeout: Optional[float] = ...,
|
||||
) -> bytes: ...
|
||||
@overload
|
||||
def check_output(
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: AnyPath = ...,
|
||||
stdin: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[AnyPath] = ...,
|
||||
env: Optional[_ENV] = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
input: _TXT = ...,
|
||||
*,
|
||||
timeout: Optional[float] = ...,
|
||||
) -> Any: ... # morally: -> _TXT
|
||||
|
||||
PIPE: int
|
||||
STDOUT: int
|
||||
DEVNULL: int
|
||||
@@ -1009,7 +864,7 @@ class Popen(Generic[AnyStr]):
|
||||
encoding: Optional[str] = ...,
|
||||
errors: Optional[str] = ...,
|
||||
) -> Popen[Any]: ...
|
||||
elif sys.version_info >= (3, 6):
|
||||
else:
|
||||
@overload
|
||||
def __new__(
|
||||
cls,
|
||||
@@ -1131,72 +986,6 @@ class Popen(Generic[AnyStr]):
|
||||
encoding: Optional[str] = ...,
|
||||
errors: Optional[str] = ...,
|
||||
) -> Popen[Any]: ...
|
||||
else:
|
||||
@overload
|
||||
def __new__(
|
||||
cls,
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: Optional[AnyPath] = ...,
|
||||
stdin: Optional[_FILE] = ...,
|
||||
stdout: Optional[_FILE] = ...,
|
||||
stderr: Optional[_FILE] = ...,
|
||||
preexec_fn: Optional[Callable[[], Any]] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[AnyPath] = ...,
|
||||
env: Optional[_ENV] = ...,
|
||||
*,
|
||||
universal_newlines: Literal[True],
|
||||
startupinfo: Optional[Any] = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
) -> Popen[str]: ...
|
||||
@overload
|
||||
def __new__(
|
||||
cls,
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: Optional[AnyPath] = ...,
|
||||
stdin: Optional[_FILE] = ...,
|
||||
stdout: Optional[_FILE] = ...,
|
||||
stderr: Optional[_FILE] = ...,
|
||||
preexec_fn: Optional[Callable[[], Any]] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[AnyPath] = ...,
|
||||
env: Optional[_ENV] = ...,
|
||||
*,
|
||||
universal_newlines: Literal[False] = ...,
|
||||
startupinfo: Optional[Any] = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
) -> Popen[bytes]: ...
|
||||
@overload
|
||||
def __new__(
|
||||
cls,
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: Optional[AnyPath] = ...,
|
||||
stdin: Optional[_FILE] = ...,
|
||||
stdout: Optional[_FILE] = ...,
|
||||
stderr: Optional[_FILE] = ...,
|
||||
preexec_fn: Optional[Callable[[], Any]] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[AnyPath] = ...,
|
||||
env: Optional[_ENV] = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Optional[Any] = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
) -> Popen[Any]: ...
|
||||
def poll(self) -> Optional[int]: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def wait(self, timeout: Optional[float] = ...) -> int: ...
|
||||
|
||||
Reference in New Issue
Block a user