]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #23197: On SSL handshake failure on matching hostname, check if the
authorVictor Stinner <victor.stinner@gmail.com>
Wed, 14 Jan 2015 16:13:28 +0000 (17:13 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Wed, 14 Jan 2015 16:13:28 +0000 (17:13 +0100)
waiter is cancelled before setting its exception.

Lib/asyncio/selector_events.py

index ca8626488659628e14c8e525a840ec49ee98657e..074a8df04ae243cedcf5cd4b96c5375cdf588d30 100644 (file)
@@ -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