From 1afc0a9591460d85626f26a32ff0c56bcc06b8d8 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Sun, 14 May 2023 14:24:07 -0700 Subject: [PATCH] [3.11] gh-98539: Make _SSLTransportProtocol.abort() safe to call when closed (GH-104474) (#104485) (cherry picked from commit fb8739f0b6291fb048a94d6312f59ba4d10a20ca) Co-authored-by: Sam Bull --- Lib/asyncio/sslproto.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 2.47.3