diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2015-01-14 17:00:29 +0100 |
|---|---|---|
| committer | Victor Stinner <victor.stinner@gmail.com> | 2015-01-14 17:00:29 +0100 |
| commit | f6641188171be65039da2aad93458c19676990cc (patch) | |
| tree | b0ef6e8a0569f892d0fc65a34979b4f00d72d4b7 /Lib/asyncio/sslproto.py | |
| parent | 923e06f77d7cd3c998913568128e8a41c55136bd (diff) | |
| parent | 177e9f0855ca398bf208a7466ed288e2ae22f6d5 (diff) | |
| download | cpython-git-f6641188171be65039da2aad93458c19676990cc.tar.gz | |
Merge 3.4 (asyncio)
Diffstat (limited to 'Lib/asyncio/sslproto.py')
| -rw-r--r-- | Lib/asyncio/sslproto.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py index 987c158ee7..541e252774 100644 --- a/Lib/asyncio/sslproto.py +++ b/Lib/asyncio/sslproto.py @@ -530,10 +530,11 @@ class SSLProtocol(protocols.Protocol): self._in_handshake = False sslobj = self._sslpipe.ssl_object - peercert = None if handshake_exc else sslobj.getpeercert() try: if handshake_exc is not None: raise handshake_exc + + peercert = sslobj.getpeercert() if not hasattr(self._sslcontext, 'check_hostname'): # Verify hostname if requested, Python 3.4+ uses check_hostname # and checks the hostname in do_handshake() @@ -551,7 +552,7 @@ class SSLProtocol(protocols.Protocol): self, exc_info=True) self._transport.close() if isinstance(exc, Exception): - if self._waiter is not None: + if self._waiter is not None and not self._waiter.cancelled(): self._waiter.set_exception(exc) return else: |
