[Python-checkins] cpython (3.5): asyncio: Fix an SSL warning in StreamReaderProtocol.eof_received
yury.selivanov
python-checkins at python.org
Fri May 20 11:32:30 EDT 2016
https://hg.python.org/cpython/rev/7c9666a055e4
changeset: 101451:7c9666a055e4
branch: 3.5
parent: 101447:72946937536e
user: Yury Selivanov <yselivanov at sprymix.com>
date: Fri May 20 11:31:40 2016 -0400
summary:
asyncio: Fix an SSL warning in StreamReaderProtocol.eof_received
files:
Lib/asyncio/streams.py | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/Lib/asyncio/streams.py b/Lib/asyncio/streams.py
--- a/Lib/asyncio/streams.py
+++ b/Lib/asyncio/streams.py
@@ -225,9 +225,11 @@
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 @@
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
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list