diff --git a/stdlib/3/subprocess.pyi b/stdlib/3/subprocess.pyi index 9de5bf4c0716..802fd750e0ae 100644 --- a/stdlib/3/subprocess.pyi +++ b/stdlib/3/subprocess.pyi @@ -3,7 +3,42 @@ # Based on http://docs.python.org/3.2/library/subprocess.html import sys -from typing import Sequence, Any, Mapping, Callable, Tuple, IO, Optional, Union +from typing import Sequence, Any, Mapping, Callable, Tuple, IO, Optional, Union, List + + +if sys.version_info >= (3, 5): + class CompletedProcess: + args = ... # type: Union[List, str] + returncode = ... # type: int + stdout = ... # type: Union[str, bytes] + stderr = ... # type: Union[str, bytes] + def __init__(self, args: Union[List, str], + returncode: int, + stdout: Union[str, bytes], + stderr: Union[str, bytes]) -> None: ... + def check_returncode(self): ... + + # Nearly same args as Popen.__init__ except for timeout, input, and check + def run(args: Union[str, Sequence[str]], + timeout: int = ..., + input: Union[str, bytes] = ..., + check: bool = ..., + bufsize: int = ..., + executable: str = ..., + stdin: Any = ..., + stdout: Any = ..., + stderr: Any = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: str = ..., + env: Mapping[str, str] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ...) -> CompletedProcess: ... # Same args as Popen.__init__ def call(args: Union[str, Sequence[str]], @@ -64,6 +99,9 @@ def check_output(args: Union[str, Sequence[str]], # TODO types PIPE = ... # type: Any STDOUT = ... # type: Any +if sys.version_info >= (3, 3): + DEVNULL = ... # type: Any + class CalledProcessError(Exception): returncode = 0