From c447ba04e78a91c1febe7744b9e6cbcdd3e23360 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 6 Jan 2015 01:13:49 +0100 Subject: Issue #23140, asyncio: Fix cancellation of Process.wait(). Check the state of the waiter future before setting its result. --- Lib/asyncio/subprocess.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Lib/asyncio/subprocess.py') diff --git a/Lib/asyncio/subprocess.py b/Lib/asyncio/subprocess.py index f6d6a141eb..a8ad03c254 100644 --- a/Lib/asyncio/subprocess.py +++ b/Lib/asyncio/subprocess.py @@ -96,7 +96,8 @@ class SubprocessStreamProtocol(streams.FlowControlMixin, returncode = self._transport.get_returncode() while self._waiters: waiter = self._waiters.popleft() - waiter.set_result(returncode) + if not waiter.cancelled(): + waiter.set_result(returncode) class Process: -- cgit v1.2.1