From 5ed39dd8ce2501d849295c7d2ae84cec11460cf7 Mon Sep 17 00:00:00 2001 From: Zsolt Dollenstein Date: Fri, 31 Aug 2018 12:56:57 +0100 Subject: [PATCH] bring protocols.pyi more inline with documentation (#2421) --- stdlib/3/asyncio/protocols.pyi | 8 ++++---- stdlib/3/asyncio/streams.pyi | 2 +- stdlib/3/asyncio/subprocess.pyi | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/stdlib/3/asyncio/protocols.pyi b/stdlib/3/asyncio/protocols.pyi index a716af7ef..bb258e119 100644 --- a/stdlib/3/asyncio/protocols.pyi +++ b/stdlib/3/asyncio/protocols.pyi @@ -1,18 +1,18 @@ from asyncio import transports -from typing import List, Text, Tuple, Union +from typing import List, Optional, Text, Tuple, Union __all__: List[str] class BaseProtocol: def connection_made(self, transport: transports.BaseTransport) -> None: ... - def connection_lost(self, exc: Exception) -> None: ... + def connection_lost(self, exc: Optional[Exception]) -> None: ... def pause_writing(self) -> None: ... def resume_writing(self) -> None: ... class Protocol(BaseProtocol): def data_received(self, data: bytes) -> None: ... - def eof_received(self) -> bool: ... + def eof_received(self) -> Optional[bool]: ... class DatagramProtocol(BaseProtocol): def datagram_received(self, data: Union[bytes, Text], addr: Tuple[str, int]) -> None: ... @@ -20,5 +20,5 @@ class DatagramProtocol(BaseProtocol): class SubprocessProtocol(BaseProtocol): def pipe_data_received(self, fd: int, data: Union[bytes, Text]) -> None: ... - def pipe_connection_lost(self, fd: int, exc: Exception) -> None: ... + def pipe_connection_lost(self, fd: int, exc: Optional[Exception]) -> None: ... def process_exited(self) -> None: ... diff --git a/stdlib/3/asyncio/streams.pyi b/stdlib/3/asyncio/streams.pyi index 2892d95ab..406839924 100644 --- a/stdlib/3/asyncio/streams.pyi +++ b/stdlib/3/asyncio/streams.pyi @@ -68,7 +68,7 @@ class StreamReaderProtocol(FlowControlMixin, protocols.Protocol): client_connected_cb: _ClientConnectedCallback = ..., loop: Optional[events.AbstractEventLoop] = ...) -> None: ... def connection_made(self, transport: transports.BaseTransport) -> None: ... - def connection_lost(self, exc: Exception) -> None: ... + def connection_lost(self, exc: Optional[Exception]) -> None: ... def data_received(self, data: bytes) -> None: ... def eof_received(self) -> bool: ... diff --git a/stdlib/3/asyncio/subprocess.pyi b/stdlib/3/asyncio/subprocess.pyi index ab2ecd8d8..33ca7226c 100644 --- a/stdlib/3/asyncio/subprocess.pyi +++ b/stdlib/3/asyncio/subprocess.pyi @@ -19,7 +19,7 @@ class SubprocessStreamProtocol(streams.FlowControlMixin, 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: Union[bytes, Text]) -> None: ... - def pipe_connection_lost(self, fd: int, exc: Exception) -> None: ... + def pipe_connection_lost(self, fd: int, exc: Optional[Exception]) -> None: ... def process_exited(self) -> None: ...