Skip to content

Commit d1f5751

Browse files
Michaël Sghaïer1st1
Michaël Sghaïer
authored andcommitted
Break circular references when closing SSLTransport objects (#981)
1 parent a0e3d2d commit d1f5751

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Lib/asyncio/sslproto.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -681,12 +681,14 @@ def _fatal_error(self, exc, message='Fatal error on transport'):
681681
self._transport._force_close(exc)
682682

683683
def _finalize(self):
684+
self._sslpipe = None
685+
684686
if self._transport is not None:
685687
self._transport.close()
686688

687689
def _abort(self):
688-
if self._transport is not None:
689-
try:
690+
try:
691+
if self._transport is not None:
690692
self._transport.abort()
691-
finally:
692-
self._finalize()
693+
finally:
694+
self._finalize()

0 commit comments

Comments
 (0)