From: Sam Bull Date: Sun, 14 May 2023 18:58:13 +0000 (+0100) Subject: gh-98539: Make _SSLTransportProtocol.abort() safe to call when closed (#104474) X-Git-Tag: v3.12.0b1~126 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fb8739f0b6291fb048a94d6312f59ba4d10a20ca;p=thirdparty%2FPython%2Fcpython.git gh-98539: Make _SSLTransportProtocol.abort() safe to call when closed (#104474) --- diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py index bbf9cad6bc7f..488e17d8bccd 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