summaryrefslogtreecommitdiff
path: root/Lib/asyncio/subprocess.py
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2018-09-12 11:43:04 -0700
committerGitHub <noreply@github.com>2018-09-12 11:43:04 -0700
commita5d1eb8d8b7add31b5f5d9bbb31cee1a491b2c08 (patch)
tree8ffce2f8bcedaea78a0f0eb9c7e1c25f0a32707a /Lib/asyncio/subprocess.py
parentaca819fb494d4801b3e5b5b507b17cab772c1b40 (diff)
downloadcpython-git-a5d1eb8d8b7add31b5f5d9bbb31cee1a491b2c08.tar.gz
bpo-34638: Store a weak reference to stream reader to break strong references loop (GH-9201)
Store a weak reference to stream readerfor breaking strong references It breaks the strong reference loop between reader and protocol and allows to detect and close the socket if the stream is deleted (garbage collected)
Diffstat (limited to 'Lib/asyncio/subprocess.py')
-rw-r--r--Lib/asyncio/subprocess.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/asyncio/subprocess.py b/Lib/asyncio/subprocess.py
index 90fc00de83..c86de3d087 100644
--- a/Lib/asyncio/subprocess.py
+++ b/Lib/asyncio/subprocess.py
@@ -36,6 +36,11 @@ class SubprocessStreamProtocol(streams.FlowControlMixin,
info.append(f'stderr={self.stderr!r}')
return '<{}>'.format(' '.join(info))
+ def _untrack_reader(self):
+ # StreamWriter.close() expects the protocol
+ # to have this method defined.
+ pass
+
def connection_made(self, transport):
self._transport = transport