summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorSam Bull <git@sambull.org>2023-05-14 18:58:13 (GMT)
committerGitHub <noreply@github.com>2023-05-14 18:58:13 (GMT)
commitfb8739f0b6291fb048a94d6312f59ba4d10a20ca (patch)
tree3c62c4831356e09922d409663ce914d770f1091e /Lib/asyncio
parent88c5c586708dcff369c49edae947d487a80f0346 (diff)
downloadcpython-fb8739f0b6291fb048a94d6312f59ba4d10a20ca.zip
cpython-fb8739f0b6291fb048a94d6312f59ba4d10a20ca.tar.gz
cpython-fb8739f0b6291fb048a94d6312f59ba4d10a20ca.tar.bz2
gh-98539: Make _SSLTransportProtocol.abort() safe to call when closed (#104474)
Diffstat (limited to 'Lib/asyncio')
-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 bbf9cad..488e17d 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