]> granicus.if.org Git - python/commitdiff
Break circular references when closing SSLTransport objects (#981)
authorMichaël Sghaïer <michael.sghaier@polyalgo.org>
Fri, 9 Jun 2017 22:29:46 +0000 (18:29 -0400)
committerYury Selivanov <yury@magic.io>
Fri, 9 Jun 2017 22:29:46 +0000 (18:29 -0400)
Lib/asyncio/sslproto.py

index a7f1e61596d6a55673b933ba96c974b69eed7f8c..68499e5aeeae7eed7a924f01225e60e92d9b8ee1 100644 (file)
@@ -681,12 +681,14 @@ class SSLProtocol(protocols.Protocol):
             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()