summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-01-09 21:29:29 +0100
committerVictor Stinner <victor.stinner@gmail.com>2015-01-09 21:29:29 +0100
commit043d683f0ffd9c625444d4dd18deaeacb4f88328 (patch)
tree7109bd5903a4f9e7001a84ec91d3b734192b7281
parent3979ddedc103202f68bb31e27ade65d9c7c4fbe9 (diff)
downloadtrollius-043d683f0ffd9c625444d4dd18deaeacb4f88328.tar.gz
Python issue #23209: Break some reference cycles in asyncio. Patch written by
Martin Richard.
-rw-r--r--asyncio/base_subprocess.py1
-rw-r--r--asyncio/futures.py2
-rw-r--r--asyncio/selectors.py1
3 files changed, 3 insertions, 1 deletions
diff --git a/asyncio/base_subprocess.py b/asyncio/base_subprocess.py
index 81698b0..afc434d 100644
--- a/asyncio/base_subprocess.py
+++ b/asyncio/base_subprocess.py
@@ -182,6 +182,7 @@ class WriteSubprocessPipeProto(protocols.BaseProtocol):
def connection_lost(self, exc):
self.disconnected = True
self.proc._pipe_connection_lost(self.fd, exc)
+ self.proc = None
def pause_writing(self):
self.proc._protocol.pause_writing()
diff --git a/asyncio/futures.py b/asyncio/futures.py
index e0e12f0..19212a9 100644
--- a/asyncio/futures.py
+++ b/asyncio/futures.py
@@ -405,5 +405,5 @@ def wrap_future(fut, *, loop=None):
new_future.add_done_callback(_check_cancel_other)
fut.add_done_callback(
lambda future: loop.call_soon_threadsafe(
- new_future._copy_state, fut))
+ new_future._copy_state, future))
return new_future
diff --git a/asyncio/selectors.py b/asyncio/selectors.py
index 598845d..5850dea 100644
--- a/asyncio/selectors.py
+++ b/asyncio/selectors.py
@@ -256,6 +256,7 @@ class _BaseSelectorImpl(BaseSelector):
def close(self):
self._fd_to_key.clear()
+ self._map = None
def get_map(self):
return self._map