mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-28 06:36:54 +08:00
@@ -38,372 +38,396 @@ _ENV = Union[Mapping[bytes, _TXT], Mapping[Text, _TXT]]
|
||||
|
||||
_T = TypeVar('_T')
|
||||
|
||||
if sys.version_info >= (3, 5):
|
||||
class CompletedProcess(Generic[_T]):
|
||||
# morally: _CMD
|
||||
args: Any
|
||||
returncode: int
|
||||
# These are really both Optional, but requiring checks would be tedious
|
||||
# and writing all the overloads would be horrific.
|
||||
stdout: _T
|
||||
stderr: _T
|
||||
def __init__(self, args: _CMD,
|
||||
returncode: int,
|
||||
stdout: Optional[_T] = ...,
|
||||
stderr: Optional[_T] = ...) -> None: ...
|
||||
def check_returncode(self) -> None: ...
|
||||
class CompletedProcess(Generic[_T]):
|
||||
# morally: _CMD
|
||||
args: Any
|
||||
returncode: int
|
||||
# These are really both Optional, but requiring checks would be tedious
|
||||
# and writing all the overloads would be horrific.
|
||||
stdout: _T
|
||||
stderr: _T
|
||||
def __init__(self, args: _CMD, returncode: int, stdout: Optional[_T] = ..., stderr: Optional[_T] = ...) -> None: ...
|
||||
def check_returncode(self) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
# Nearly the same args as for 3.6, except for capture_output and text
|
||||
@overload
|
||||
def run(args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: _PATH = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_PATH] = ...,
|
||||
env: Optional[_ENV] = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
capture_output: bool = ...,
|
||||
check: bool = ...,
|
||||
encoding: Optional[str] = ...,
|
||||
errors: Optional[str] = ...,
|
||||
input: Optional[str] = ...,
|
||||
text: Literal[True],
|
||||
timeout: Optional[float] = ...) -> CompletedProcess[str]: ...
|
||||
@overload
|
||||
def run(args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: _PATH = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_PATH] = ...,
|
||||
env: Optional[_ENV] = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
capture_output: bool = ...,
|
||||
check: bool = ...,
|
||||
encoding: str,
|
||||
errors: Optional[str] = ...,
|
||||
input: Optional[str] = ...,
|
||||
text: Optional[bool] = ...,
|
||||
timeout: Optional[float] = ...) -> CompletedProcess[str]: ...
|
||||
@overload
|
||||
def run(args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: _PATH = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_PATH] = ...,
|
||||
env: Optional[_ENV] = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
capture_output: bool = ...,
|
||||
check: bool = ...,
|
||||
encoding: Optional[str] = ...,
|
||||
errors: str,
|
||||
input: Optional[str] = ...,
|
||||
text: Optional[bool] = ...,
|
||||
timeout: Optional[float] = ...) -> CompletedProcess[str]: ...
|
||||
@overload
|
||||
def run(args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: _PATH = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_PATH] = ...,
|
||||
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
|
||||
capture_output: bool = ...,
|
||||
check: bool = ...,
|
||||
encoding: Optional[str] = ...,
|
||||
errors: Optional[str] = ...,
|
||||
input: Optional[str] = ...,
|
||||
text: Optional[bool] = ...,
|
||||
timeout: Optional[float] = ...) -> CompletedProcess[str]: ...
|
||||
@overload
|
||||
def run(args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: _PATH = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_PATH] = ...,
|
||||
env: Optional[_ENV] = ...,
|
||||
universal_newlines: Literal[False] = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
capture_output: bool = ...,
|
||||
check: bool = ...,
|
||||
encoding: None = ...,
|
||||
errors: None = ...,
|
||||
input: Optional[bytes] = ...,
|
||||
text: Literal[None, False] = ...,
|
||||
timeout: Optional[float] = ...) -> CompletedProcess[bytes]: ...
|
||||
@overload
|
||||
def run(args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: _PATH = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_PATH] = ...,
|
||||
env: Optional[_ENV] = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
capture_output: bool = ...,
|
||||
check: bool = ...,
|
||||
encoding: Optional[str] = ...,
|
||||
errors: Optional[str] = ...,
|
||||
input: Optional[_TXT] = ...,
|
||||
text: Optional[bool] = ...,
|
||||
timeout: Optional[float] = ...) -> CompletedProcess[Any]: ...
|
||||
elif sys.version_info >= (3, 6):
|
||||
# Nearly same args as Popen.__init__ except for timeout, input, and check
|
||||
@overload
|
||||
def run(args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: _PATH = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_PATH] = ...,
|
||||
env: Optional[_ENV] = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
check: bool = ...,
|
||||
encoding: str,
|
||||
errors: Optional[str] = ...,
|
||||
input: Optional[str] = ...,
|
||||
timeout: Optional[float] = ...) -> CompletedProcess[str]: ...
|
||||
@overload
|
||||
def run(args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: _PATH = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_PATH] = ...,
|
||||
env: Optional[_ENV] = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
check: bool = ...,
|
||||
encoding: Optional[str] = ...,
|
||||
errors: str,
|
||||
input: Optional[str] = ...,
|
||||
timeout: Optional[float] = ...) -> CompletedProcess[str]: ...
|
||||
@overload
|
||||
def run(args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: _PATH = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_PATH] = ...,
|
||||
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 = ...,
|
||||
encoding: Optional[str] = ...,
|
||||
errors: Optional[str] = ...,
|
||||
input: Optional[str] = ...,
|
||||
timeout: Optional[float] = ...) -> CompletedProcess[str]: ...
|
||||
@overload
|
||||
def run(args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: _PATH = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_PATH] = ...,
|
||||
env: Optional[_ENV] = ...,
|
||||
universal_newlines: Literal[False] = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
check: bool = ...,
|
||||
encoding: None = ...,
|
||||
errors: None = ...,
|
||||
input: Optional[bytes] = ...,
|
||||
timeout: Optional[float] = ...) -> CompletedProcess[bytes]: ...
|
||||
@overload
|
||||
def run(args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: _PATH = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_PATH] = ...,
|
||||
env: Optional[_ENV] = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
check: bool = ...,
|
||||
encoding: Optional[str] = ...,
|
||||
errors: Optional[str] = ...,
|
||||
input: Optional[_TXT] = ...,
|
||||
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: _PATH = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_PATH] = ...,
|
||||
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: _PATH = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_PATH] = ...,
|
||||
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: _PATH = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_PATH] = ...,
|
||||
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]: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
# Nearly the same args as for 3.6, except for capture_output and text
|
||||
@overload
|
||||
def run(
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: _PATH = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_PATH] = ...,
|
||||
env: Optional[_ENV] = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
capture_output: bool = ...,
|
||||
check: bool = ...,
|
||||
encoding: Optional[str] = ...,
|
||||
errors: Optional[str] = ...,
|
||||
input: Optional[str] = ...,
|
||||
text: Literal[True],
|
||||
timeout: Optional[float] = ...,
|
||||
) -> CompletedProcess[str]: ...
|
||||
@overload
|
||||
def run(
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: _PATH = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_PATH] = ...,
|
||||
env: Optional[_ENV] = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
capture_output: bool = ...,
|
||||
check: bool = ...,
|
||||
encoding: str,
|
||||
errors: Optional[str] = ...,
|
||||
input: Optional[str] = ...,
|
||||
text: Optional[bool] = ...,
|
||||
timeout: Optional[float] = ...,
|
||||
) -> CompletedProcess[str]: ...
|
||||
@overload
|
||||
def run(
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: _PATH = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_PATH] = ...,
|
||||
env: Optional[_ENV] = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
capture_output: bool = ...,
|
||||
check: bool = ...,
|
||||
encoding: Optional[str] = ...,
|
||||
errors: str,
|
||||
input: Optional[str] = ...,
|
||||
text: Optional[bool] = ...,
|
||||
timeout: Optional[float] = ...,
|
||||
) -> CompletedProcess[str]: ...
|
||||
@overload
|
||||
def run(
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: _PATH = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_PATH] = ...,
|
||||
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
|
||||
capture_output: bool = ...,
|
||||
check: bool = ...,
|
||||
encoding: Optional[str] = ...,
|
||||
errors: Optional[str] = ...,
|
||||
input: Optional[str] = ...,
|
||||
text: Optional[bool] = ...,
|
||||
timeout: Optional[float] = ...,
|
||||
) -> CompletedProcess[str]: ...
|
||||
@overload
|
||||
def run(
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: _PATH = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_PATH] = ...,
|
||||
env: Optional[_ENV] = ...,
|
||||
universal_newlines: Literal[False] = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
capture_output: bool = ...,
|
||||
check: bool = ...,
|
||||
encoding: None = ...,
|
||||
errors: None = ...,
|
||||
input: Optional[bytes] = ...,
|
||||
text: Literal[None, False] = ...,
|
||||
timeout: Optional[float] = ...,
|
||||
) -> CompletedProcess[bytes]: ...
|
||||
@overload
|
||||
def run(
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: _PATH = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_PATH] = ...,
|
||||
env: Optional[_ENV] = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
capture_output: bool = ...,
|
||||
check: bool = ...,
|
||||
encoding: Optional[str] = ...,
|
||||
errors: Optional[str] = ...,
|
||||
input: Optional[_TXT] = ...,
|
||||
text: Optional[bool] = ...,
|
||||
timeout: Optional[float] = ...,
|
||||
) -> CompletedProcess[Any]: ...
|
||||
elif sys.version_info >= (3, 6):
|
||||
# Nearly same args as Popen.__init__ except for timeout, input, and check
|
||||
@overload
|
||||
def run(
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: _PATH = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_PATH] = ...,
|
||||
env: Optional[_ENV] = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
check: bool = ...,
|
||||
encoding: str,
|
||||
errors: Optional[str] = ...,
|
||||
input: Optional[str] = ...,
|
||||
timeout: Optional[float] = ...,
|
||||
) -> CompletedProcess[str]: ...
|
||||
@overload
|
||||
def run(
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: _PATH = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_PATH] = ...,
|
||||
env: Optional[_ENV] = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
check: bool = ...,
|
||||
encoding: Optional[str] = ...,
|
||||
errors: str,
|
||||
input: Optional[str] = ...,
|
||||
timeout: Optional[float] = ...,
|
||||
) -> CompletedProcess[str]: ...
|
||||
@overload
|
||||
def run(
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: _PATH = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_PATH] = ...,
|
||||
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 = ...,
|
||||
encoding: Optional[str] = ...,
|
||||
errors: Optional[str] = ...,
|
||||
input: Optional[str] = ...,
|
||||
timeout: Optional[float] = ...,
|
||||
) -> CompletedProcess[str]: ...
|
||||
@overload
|
||||
def run(
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: _PATH = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_PATH] = ...,
|
||||
env: Optional[_ENV] = ...,
|
||||
universal_newlines: Literal[False] = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
check: bool = ...,
|
||||
encoding: None = ...,
|
||||
errors: None = ...,
|
||||
input: Optional[bytes] = ...,
|
||||
timeout: Optional[float] = ...,
|
||||
) -> CompletedProcess[bytes]: ...
|
||||
@overload
|
||||
def run(
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: _PATH = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_PATH] = ...,
|
||||
env: Optional[_ENV] = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
check: bool = ...,
|
||||
encoding: Optional[str] = ...,
|
||||
errors: Optional[str] = ...,
|
||||
input: Optional[_TXT] = ...,
|
||||
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: _PATH = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_PATH] = ...,
|
||||
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: _PATH = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_PATH] = ...,
|
||||
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: _PATH = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_PATH] = ...,
|
||||
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,
|
||||
@@ -795,10 +819,9 @@ class CalledProcessError(Exception):
|
||||
# morally: Optional[_TXT]
|
||||
output: Any
|
||||
|
||||
if sys.version_info >= (3, 5):
|
||||
# morally: Optional[_TXT]
|
||||
stdout: Any
|
||||
stderr: Any
|
||||
# morally: Optional[_TXT]
|
||||
stdout: Any
|
||||
stderr: Any
|
||||
|
||||
def __init__(self,
|
||||
returncode: int,
|
||||
|
||||
Reference in New Issue
Block a user