diff --git a/stdlib/2.7/subprocess.pyi b/stdlib/2.7/subprocess.pyi index 6053a4ede..7a42eff65 100644 --- a/stdlib/2.7/subprocess.pyi +++ b/stdlib/2.7/subprocess.pyi @@ -8,15 +8,15 @@ _FILE = Union[int, IO[Any]] # TODO force keyword arguments # TODO more keyword arguments (from Popen) -def call(args: Sequence[str], *, +def call(args: Union[str, Sequence[str]], *, stdin: _FILE = ..., stdout: _FILE = ..., stderr: _FILE = ..., shell: bool = ..., env: Mapping[str, str] = ..., cwd: str = ...) -> int: ... -def check_call(args: Sequence[str], *, +def check_call(args: Union[str, Sequence[str]], *, stdin: _FILE = ..., stdout: _FILE = ..., stderr: _FILE = ..., shell: bool = ..., env: Mapping[str, str] = ..., cwd: str = ..., close_fds: Sequence[_FILE] = ..., preexec_fn: Callable[[], Any] = ...) -> int: ... -def check_output(args: Sequence[str], *, +def check_output(args: Union[str, Sequence[str]], *, stdin: _FILE = ..., stderr: _FILE = ..., shell: bool = ..., universal_newlines: bool = ..., env: Mapping[str, str] = ..., cwd: str = ...) -> str: ... @@ -29,7 +29,7 @@ class CalledProcessError(Exception): cmd = ... # type: str output = ... # type: str # May be None - def __init__(self, returncode: int, cmd: str, output: str = ...) -> None: ... + def __init__(self, returncode: int, cmd: str, output: Optional[str] = ...) -> None: ... class Popen: stdin = ... # type: Optional[IO[Any]] @@ -39,7 +39,7 @@ class Popen: returncode = 0 def __init__(self, - args: Sequence[str], + args: Union[str, Sequence[str]], bufsize: int = ..., executable: str = ..., stdin: _FILE = ..., diff --git a/stdlib/3/subprocess.pyi b/stdlib/3/subprocess.pyi index c606c33db..83d62cf9e 100644 --- a/stdlib/3/subprocess.pyi +++ b/stdlib/3/subprocess.pyi @@ -2,20 +2,20 @@ # Based on http://docs.python.org/3.2/library/subprocess.html -from typing import Sequence, Any, Mapping, Callable, Tuple, IO +from typing import Sequence, Any, Mapping, Callable, Tuple, IO, Optional, Union # TODO force keyword arguments # TODO more keyword arguments -def call(args: Sequence[str], *, stdin: Any = ..., stdout: Any = ..., +def call(args: Union[str, Sequence[str]], *, stdin: Any = ..., stdout: Any = ..., stderr: Any = ..., shell: bool = ..., env: Mapping[str, str] = ..., cwd: str = ...) -> int: ... -def check_call(args: Sequence[str], *, stdin: Any = ..., stdout: Any = ..., +def check_call(args: Union[str, Sequence[str]], *, stdin: Any = ..., stdout: Any = ..., stderr: Any = ..., shell: bool = ..., env: Mapping[str, str] = ..., cwd: str = ...) -> int: ... # Return str/bytes -def check_output(args: Sequence[str], *, stdin: Any = ..., stderr: Any = ..., +def check_output(args: Union[str, Sequence[str]], *, stdin: Any = ..., stderr: Any = ..., shell: bool = ..., universal_newlines: bool = ..., env: Mapping[str, str] = ..., cwd: str = ...) -> Any: ... @@ -29,7 +29,8 @@ class CalledProcessError(Exception): cmd = ... # type: str output = b'' # May be None - def __init__(self, returncode: int, cmd: str, output: str = ...) -> None: ... + def __init__(self, returncode: int, cmd: str, output: Optional[str], + stderr: Optional[str] = ...) -> None: ... class Popen: stdin = ... # type: IO[Any] @@ -39,7 +40,7 @@ class Popen: returncode = 0 def __init__(self, - args: Sequence[str], + args: Union[str, Sequence[str]], bufsize: int = ..., executable: str = ..., stdin: Any = ...,