From: Victor Stinner Date: Wed, 14 Jan 2015 16:13:28 +0000 (+0100) Subject: Issue #23197: On SSL handshake failure on matching hostname, check if the X-Git-Tag: v3.4.3rc1~141 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b92626df5ca72d25236404a0a62cf47279c4e503;p=thirdparty%2FPython%2Fcpython.git Issue #23197: On SSL handshake failure on matching hostname, check if the waiter is cancelled before setting its exception. --- diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py index ca8626488659..074a8df04ae2 100644 --- a/Lib/asyncio/selector_events.py +++ b/Lib/asyncio/selector_events.py @@ -774,7 +774,8 @@ class _SelectorSslTransport(_SelectorTransport): "on matching the hostname", self, exc_info=True) self._sock.close() - if self._waiter is not None: + if (self._waiter is not None + and not self._waiter.cancelled()): self._waiter.set_exception(exc) return