[Python-checkins] cpython (3.4): Issue #23209: Break some reference cycles in asyncio. Patch written by Martin

victor.stinner python-checkins at python.org
Fri Jan 9 21:36:37 CET 2015


https://hg.python.org/cpython/rev/376c5398f28d
changeset:   94094:376c5398f28d
branch:      3.4
parent:      94092:b6a636823c8c
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Fri Jan 09 21:34:27 2015 +0100
summary:
  Issue #23209: Break some reference cycles in asyncio. Patch written by Martin
Richard.

files:
  Lib/asyncio/base_subprocess.py |  1 +
  Lib/asyncio/futures.py         |  2 +-
  Lib/selectors.py               |  1 +
  3 files changed, 3 insertions(+), 1 deletions(-)


diff --git a/Lib/asyncio/base_subprocess.py b/Lib/asyncio/base_subprocess.py
--- a/Lib/asyncio/base_subprocess.py
+++ b/Lib/asyncio/base_subprocess.py
@@ -182,6 +182,7 @@
     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/Lib/asyncio/futures.py b/Lib/asyncio/futures.py
--- a/Lib/asyncio/futures.py
+++ b/Lib/asyncio/futures.py
@@ -405,5 +405,5 @@
     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/Lib/selectors.py b/Lib/selectors.py
--- a/Lib/selectors.py
+++ b/Lib/selectors.py
@@ -256,6 +256,7 @@
 
     def close(self):
         self._fd_to_key.clear()
+        self._map = None
 
     def get_map(self):
         return self._map

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list