Break circular references when closing SSLTransport objects (#981) (#2049)
diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py
index 6e9ce29..7948c4c 100644
--- a/Lib/asyncio/sslproto.py
+++ b/Lib/asyncio/sslproto.py
@@ -686,12 +686,14 @@
self._transport._force_close(exc)
def _finalize(self):
+ self._sslpipe = None
+
if self._transport is not None:
self._transport.close()
def _abort(self):
- if self._transport is not None:
- try:
+ try:
+ if self._transport is not None:
self._transport.abort()
- finally:
- self._finalize()
+ finally:
+ self._finalize()