summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2017-06-09 23:14:35 (GMT)
committerGitHub <noreply@github.com>2017-06-09 23:14:35 (GMT)
commitfe9c7a0fd3412efb7598b395e70a5a85219e2e6b (patch)
tree6f2def8aa4923b648b4f317495b939a35c7f2e1a /Lib/asyncio
parent7a16a4535d691eff79fcc65ae57e69741e6c83df (diff)
downloadcpython-fe9c7a0fd3412efb7598b395e70a5a85219e2e6b.zip
cpython-fe9c7a0fd3412efb7598b395e70a5a85219e2e6b.tar.gz
cpython-fe9c7a0fd3412efb7598b395e70a5a85219e2e6b.tar.bz2
Break circular references when closing SSLTransport objects (#981) (#2049)
Diffstat (limited to 'Lib/asyncio')
-rw-r--r--Lib/asyncio/sslproto.py10
1 files changed, 6 insertions, 4 deletions
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 @@ 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()