]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-98539: Make _SSLTransportProtocol.abort() safe to call when closed (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 14 May 2023 21:24:07 +0000 (14:24 -0700)
committerGitHub <noreply@github.com>
Sun, 14 May 2023 21:24:07 +0000 (21:24 +0000)
(cherry picked from commit fb8739f0b6291fb048a94d6312f59ba4d10a20ca)

Co-authored-by: Sam Bull <git@sambull.org>
Lib/asyncio/sslproto.py

index bbf9cad6bc7f86e30fcd73f3b3cecf4d13386f0e..488e17d8bccd5bfa07a37d94b54204007d24bb8d 100644 (file)
@@ -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