[3.11] gh-98539: Make _SSLTransportProtocol.abort() safe to call when closed (GH-104474) (#104485)

(cherry picked from commit fb8739f0b6)

Co-authored-by: Sam Bull <git@sambull.org>
This commit is contained in:
Miss Islington (bot) 2023-05-14 14:24:07 -07:00 committed by GitHub
parent 8e79414efc
commit 1afc0a9591
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -244,7 +244,8 @@ def abort(self):
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