summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Bull <git@sambull.org>2023-05-14 19:58:13 +0100
committerGitHub <noreply@github.com>2023-05-14 11:58:13 -0700
commitfb8739f0b6291fb048a94d6312f59ba4d10a20ca (patch)
tree3c62c4831356e09922d409663ce914d770f1091e
parent88c5c586708dcff369c49edae947d487a80f0346 (diff)
downloadcpython-git-fb8739f0b6291fb048a94d6312f59ba4d10a20ca.tar.gz
gh-98539: Make _SSLTransportProtocol.abort() safe to call when closed (#104474)
-rw-r--r--Lib/asyncio/sslproto.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py
index bbf9cad6bc..488e17d8bc 100644
--- a/Lib/asyncio/sslproto.py
+++ b/Lib/asyncio/sslproto.py
@@ -244,7 +244,8 @@ class _SSLProtocolTransport(transports._FlowControlMixin,
called with None as its argument.
"""
self._closed = True
- self._ssl_protocol._abort()
+ if self._ssl_protocol is not None:
+ self._ssl_protocol._abort()
def _force_close(self, exc):
self._closed = True