From: Michaël Sghaïer Date: Fri, 9 Jun 2017 22:29:46 +0000 (-0400) Subject: Break circular references when closing SSLTransport objects (#981) X-Git-Tag: v3.7.0a1~648 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d1f575116ae5040ce36ca6097be2ab5dab8e4f53;p=thirdparty%2FPython%2Fcpython.git Break circular references when closing SSLTransport objects (#981) --- diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py index a7f1e61596d6..68499e5aeeae 100644 --- a/Lib/asyncio/sslproto.py +++ b/Lib/asyncio/sslproto.py @@ -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()