summaryrefslogtreecommitdiff
path: root/Lib/asyncio/subprocess.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-01-06 01:13:49 +0100
committerVictor Stinner <victor.stinner@gmail.com>2015-01-06 01:13:49 +0100
commitc447ba04e78a91c1febe7744b9e6cbcdd3e23360 (patch)
tree0394193daabdbf3280e89eec0c0ac49d8779f90c /Lib/asyncio/subprocess.py
parent8c1a4a2326e8a81bd4cc4fb81e51c003059cd687 (diff)
downloadcpython-git-c447ba04e78a91c1febe7744b9e6cbcdd3e23360.tar.gz
Issue #23140, asyncio: Fix cancellation of Process.wait(). Check the state of
the waiter future before setting its result.
Diffstat (limited to 'Lib/asyncio/subprocess.py')
-rw-r--r--Lib/asyncio/subprocess.py3
1 files changed, 2 insertions, 1 deletions
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: