gh-98539: Make _SSLTransportProtocol.abort() safe to call when closed (#104474)

This commit is contained in:
Sam Bull 2023-05-14 19:58:13 +01:00 committed by GitHub
parent 88c5c58670
commit fb8739f0b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -244,7 +244,8 @@ class _SSLProtocolTransport(transports._FlowControlMixin,
called with None as its argument. called with None as its argument.
""" """
self._closed = True self._closed = True
self._ssl_protocol._abort() if self._ssl_protocol is not None:
self._ssl_protocol._abort()
def _force_close(self, exc): def _force_close(self, exc):
self._closed = True self._closed = True