Skip to content

Commit 9429ac0

Browse files
n8henriematthiaskramm
authored andcommitted
Use Union[bytes, Text] instead of AnyStr (#1819)
1 parent 76c733d commit 9429ac0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

stdlib/3.4/asyncio/protocols.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from asyncio import transports
2-
from typing import AnyStr, List, Tuple
2+
from typing import List, Text, Tuple, Union
33

44
__all__: List[str]
55

@@ -15,10 +15,10 @@ class Protocol(BaseProtocol):
1515
def eof_received(self) -> bool: ...
1616

1717
class DatagramProtocol(BaseProtocol):
18-
def datagram_received(self, data: AnyStr, addr: Tuple[str, int]) -> None: ...
18+
def datagram_received(self, data: Union[bytes, Text], addr: Tuple[str, int]) -> None: ...
1919
def error_received(self, exc: Exception) -> None: ...
2020

2121
class SubprocessProtocol(BaseProtocol):
22-
def pipe_data_received(self, fd: int, data: AnyStr) -> None: ...
22+
def pipe_data_received(self, fd: int, data: Union[bytes, Text]) -> None: ...
2323
def pipe_connection_lost(self, fd: int, exc: Exception) -> None: ...
2424
def process_exited(self) -> None: ...

stdlib/3.4/asyncio/subprocess.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ from asyncio import protocols
33
from asyncio import streams
44
from asyncio import transports
55
from asyncio.coroutines import coroutine
6-
from typing import Any, AnyStr, Generator, List, Optional, Tuple, Union, IO
6+
from typing import Any, Generator, List, Optional, Text, Tuple, Union, IO
77

88
__all__: List[str]
99

@@ -18,7 +18,7 @@ class SubprocessStreamProtocol(streams.FlowControlMixin,
1818
stderr = ... # type: Optional[streams.StreamReader]
1919
def __init__(self, limit: int, loop: events.AbstractEventLoop) -> None: ...
2020
def connection_made(self, transport: transports.BaseTransport) -> None: ...
21-
def pipe_data_received(self, fd: int, data: AnyStr) -> None: ...
21+
def pipe_data_received(self, fd: int, data: Union[bytes, Text]) -> None: ...
2222
def pipe_connection_lost(self, fd: int, exc: Exception) -> None: ...
2323
def process_exited(self) -> None: ...
2424

0 commit comments

Comments
 (0)