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

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