summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2016-12-16 16:52:36 (GMT)
committerYury Selivanov <yury@magic.io>2016-12-16 16:52:36 (GMT)
commit7c3e71163b9aa53caf5e5b73520a07968f39686c (patch)
tree4f6f5d0fd68c41602f151a63062e8952a3def893 /Lib
parent5ab81d787f455ba28367b5b71606cea376283574 (diff)
parent11c135136d1fd5a14afdfeabf9d8fcd386a1c105 (diff)
downloadcpython-7c3e71163b9aa53caf5e5b73520a07968f39686c.zip
cpython-7c3e71163b9aa53caf5e5b73520a07968f39686c.tar.gz
cpython-7c3e71163b9aa53caf5e5b73520a07968f39686c.tar.bz2
Merge 3.6 (issue #28990)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/asyncio/sslproto.py1
-rw-r--r--Lib/test/test_asyncio/test_sslproto.py10
2 files changed, 11 insertions, 0 deletions
diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py
index 991c77b..7ad28d6 100644
--- a/Lib/asyncio/sslproto.py
+++ b/Lib/asyncio/sslproto.py
@@ -480,6 +480,7 @@ class SSLProtocol(protocols.Protocol):
self._loop.call_soon(self._app_protocol.connection_lost, exc)
self._transport = None
self._app_transport = None
+ self._wakeup_waiter(exc)
def pause_writing(self):
"""Called when the low-level transport's buffer goes over
diff --git a/Lib/test/test_asyncio/test_sslproto.py b/Lib/test/test_asyncio/test_sslproto.py
index 0ca6d1b..59ff0f6 100644
--- a/Lib/test/test_asyncio/test_sslproto.py
+++ b/Lib/test/test_asyncio/test_sslproto.py
@@ -85,5 +85,15 @@ class SslProtoHandshakeTests(test_utils.TestCase):
# Restore error logging.
log.logger.setLevel(log_level)
+ def test_connection_lost(self):
+ # From issue #472.
+ # yield from waiter hang if lost_connection was called.
+ waiter = asyncio.Future(loop=self.loop)
+ ssl_proto = self.ssl_protocol(waiter)
+ self.connection_made(ssl_proto)
+ ssl_proto.connection_lost(ConnectionAbortedError)
+ test_utils.run_briefly(self.loop)
+ self.assertIsInstance(waiter.exception(), ConnectionAbortedError)
+
if __name__ == '__main__':
unittest.main()