diff --git a/Lib/asyncio/base_subprocess.py b/Lib/asyncio/base_subprocess.py index 81698b09850..afc434defa2 100644 --- a/Lib/asyncio/base_subprocess.py +++ b/Lib/asyncio/base_subprocess.py @@ -182,6 +182,7 @@ def __repr__(self): 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 index e0e12f0579b..19212a94b9f 100644 --- a/Lib/asyncio/futures.py +++ b/Lib/asyncio/futures.py @@ -405,5 +405,5 @@ def _check_cancel_other(f): 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 index 598845d43b0..5850deaddf7 100644 --- a/Lib/selectors.py +++ b/Lib/selectors.py @@ -256,6 +256,7 @@ def modify(self, fileobj, events, data=None): def close(self): self._fd_to_key.clear() + self._map = None def get_map(self): return self._map