From 3dc5129d4fd26d97c1cd8176f6e085db99e38036 Mon Sep 17 00:00:00 2001 From: Yury Selivanov Date: Fri, 20 May 2016 11:31:40 -0400 Subject: [PATCH] asyncio: Fix an SSL warning in StreamReaderProtocol.eof_received --- Lib/asyncio/streams.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Lib/asyncio/streams.py b/Lib/asyncio/streams.py index 0345a3d3918..6f465afde2e 100644 --- a/Lib/asyncio/streams.py +++ b/Lib/asyncio/streams.py @@ -225,9 +225,11 @@ class StreamReaderProtocol(FlowControlMixin, protocols.Protocol): self._stream_reader = stream_reader self._stream_writer = None self._client_connected_cb = client_connected_cb + self._over_ssl = False def connection_made(self, transport): self._stream_reader.set_transport(transport) + self._over_ssl = transport.get_extra_info('sslcontext') is not None if self._client_connected_cb is not None: self._stream_writer = StreamWriter(transport, self, self._stream_reader, @@ -252,6 +254,11 @@ class StreamReaderProtocol(FlowControlMixin, protocols.Protocol): def eof_received(self): self._stream_reader.feed_eof() + if self._over_ssl: + # Prevent a warning in SSLProtocol.eof_received: + # "returning true from eof_received() + # has no effect when using ssl" + return False return True