mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Switch to PEP-604 syntax in python2 stubs (#5915)
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
This commit is contained in:
@@ -16,8 +16,8 @@ def call(
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_TXT] = ...,
|
||||
env: Optional[_ENV] = ...,
|
||||
cwd: _TXT | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
@@ -32,8 +32,8 @@ def check_call(
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_TXT] = ...,
|
||||
env: Optional[_ENV] = ...,
|
||||
cwd: _TXT | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
@@ -49,8 +49,8 @@ def check_output(
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_TXT] = ...,
|
||||
env: Optional[_ENV] = ...,
|
||||
cwd: _TXT | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
@@ -65,38 +65,38 @@ class CalledProcessError(Exception):
|
||||
cmd: Any
|
||||
# morally: Optional[bytes]
|
||||
output: bytes
|
||||
def __init__(self, returncode: int, cmd: _CMD, output: Optional[bytes] = ...) -> None: ...
|
||||
def __init__(self, returncode: int, cmd: _CMD, output: bytes | None = ...) -> None: ...
|
||||
|
||||
# We use a dummy type variable used to make Popen generic like it is in python 3
|
||||
_T = TypeVar("_T", bound=bytes)
|
||||
|
||||
class Popen(Generic[_T]):
|
||||
stdin: Optional[IO[bytes]]
|
||||
stdout: Optional[IO[bytes]]
|
||||
stderr: Optional[IO[bytes]]
|
||||
stdin: IO[bytes] | None
|
||||
stdout: IO[bytes] | None
|
||||
stderr: IO[bytes] | None
|
||||
pid: int
|
||||
returncode: int
|
||||
def __new__(
|
||||
cls,
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: Optional[_TXT] = ...,
|
||||
stdin: Optional[_FILE] = ...,
|
||||
stdout: Optional[_FILE] = ...,
|
||||
stderr: Optional[_FILE] = ...,
|
||||
preexec_fn: Optional[Callable[[], Any]] = ...,
|
||||
executable: _TXT | None = ...,
|
||||
stdin: _FILE | None = ...,
|
||||
stdout: _FILE | None = ...,
|
||||
stderr: _FILE | None = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: Optional[_TXT] = ...,
|
||||
env: Optional[_ENV] = ...,
|
||||
cwd: _TXT | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Optional[Any] = ...,
|
||||
startupinfo: Any | None = ...,
|
||||
creationflags: int = ...,
|
||||
) -> Popen[bytes]: ...
|
||||
def poll(self) -> Optional[int]: ...
|
||||
def poll(self) -> int | None: ...
|
||||
def wait(self) -> int: ...
|
||||
# morally: -> Tuple[Optional[bytes], Optional[bytes]]
|
||||
def communicate(self, input: Optional[_TXT] = ...) -> Tuple[bytes, bytes]: ...
|
||||
def communicate(self, input: _TXT | None = ...) -> Tuple[bytes, bytes]: ...
|
||||
def send_signal(self, signal: int) -> None: ...
|
||||
def terminate(self) -> None: ...
|
||||
def kill(self) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user