Use Union[bytes, Text] instead of AnyStr (#1819)

This commit is contained in:
Nathan Henrie authored and Matthias Kramm committed 2018-01-11 08:23:39 -08:00
1 parent 76c733dc5b
commit 9429ac070b
2 files changed
+5 -5

No files matched your search

+3 -3
View File
@@ -1,5 +1,5 @@
from asyncio import transports
from typing import AnyStr, List, Tuple
from typing import List, Text, Tuple, Union
__all__: List[str]
@@ -15,10 +15,10 @@ class Protocol(BaseProtocol):
def eof_received(self) -> bool: ...
class DatagramProtocol(BaseProtocol):
def datagram_received(self, data: AnyStr, addr: Tuple[str, int]) -> None: ...
def datagram_received(self, data: Union[bytes, Text], addr: Tuple[str, int]) -> None: ...
def error_received(self, exc: Exception) -> None: ...
class SubprocessProtocol(BaseProtocol):
def pipe_data_received(self, fd: int, data: AnyStr) -> None: ...
def pipe_data_received(self, fd: int, data: Union[bytes, Text]) -> None: ...
def pipe_connection_lost(self, fd: int, exc: Exception) -> None: ...
def process_exited(self) -> None: ...
+2 -2
View File
@@ -3,7 +3,7 @@ from asyncio import protocols
from asyncio import streams
from asyncio import transports
from asyncio.coroutines import coroutine
from typing import Any, AnyStr, Generator, List, Optional, Tuple, Union, IO
from typing import Any, Generator, List, Optional, Text, Tuple, Union, IO
__all__: List[str]
@@ -18,7 +18,7 @@ class SubprocessStreamProtocol(streams.FlowControlMixin,
stderr = ... # type: Optional[streams.StreamReader]
def __init__(self, limit: int, loop: events.AbstractEventLoop) -> None: ...
def connection_made(self, transport: transports.BaseTransport) -> None: ...
def pipe_data_received(self, fd: int, data: AnyStr) -> None: ...
def pipe_data_received(self, fd: int, data: Union[bytes, Text]) -> None: ...
def pipe_connection_lost(self, fd: int, exc: Exception) -> None: ...
def process_exited(self) -> None: ...