mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Improve asyncio.subprocess stubs (#5327)
This commit is contained in:
@@ -9,6 +9,7 @@ from asyncio.transports import BaseTransport
|
||||
from asyncio.unix_events import AbstractChildWatcher
|
||||
from socket import AddressFamily, SocketKind, _Address, _RetAddress, socket
|
||||
from typing import IO, Any, Awaitable, Callable, Dict, Generator, List, Optional, Sequence, Tuple, TypeVar, Union, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
from contextvars import Context
|
||||
@@ -399,19 +400,31 @@ class AbstractEventLoop(metaclass=ABCMeta):
|
||||
protocol_factory: _ProtocolFactory,
|
||||
cmd: Union[bytes, str],
|
||||
*,
|
||||
stdin: Any = ...,
|
||||
stdout: Any = ...,
|
||||
stderr: Any = ...,
|
||||
stdin: Union[int, IO[Any], None] = ...,
|
||||
stdout: Union[int, IO[Any], None] = ...,
|
||||
stderr: Union[int, IO[Any], None] = ...,
|
||||
universal_newlines: Literal[False] = ...,
|
||||
shell: Literal[True] = ...,
|
||||
bufsize: Literal[0] = ...,
|
||||
encoding: None = ...,
|
||||
errors: None = ...,
|
||||
text: Literal[False, None] = ...,
|
||||
**kwargs: Any,
|
||||
) -> _TransProtPair: ...
|
||||
@abstractmethod
|
||||
async def subprocess_exec(
|
||||
self,
|
||||
protocol_factory: _ProtocolFactory,
|
||||
program: Any,
|
||||
*args: Any,
|
||||
stdin: Any = ...,
|
||||
stdout: Any = ...,
|
||||
stderr: Any = ...,
|
||||
stdin: Union[int, IO[Any], None] = ...,
|
||||
stdout: Union[int, IO[Any], None] = ...,
|
||||
stderr: Union[int, IO[Any], None] = ...,
|
||||
universal_newlines: Literal[False] = ...,
|
||||
shell: Literal[True] = ...,
|
||||
bufsize: Literal[0] = ...,
|
||||
encoding: None = ...,
|
||||
errors: None = ...,
|
||||
**kwargs: Any,
|
||||
) -> _TransProtPair: ...
|
||||
@abstractmethod
|
||||
|
||||
Reference in New Issue
Block a user