diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-02-20 09:12:59 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-02-20 09:12:59 (GMT) |
commit | 8d0230b0f2e9b7f8b6dcb56556d15c9590c6c519 (patch) | |
tree | 7d2ed1e39d24100a17f7b5e57b917b7ea1fbfb77 /Lib/asyncio/subprocess.py | |
parent | a96ed63d36ec7950d9f4135770f910a341f530df (diff) | |
download | cpython-8d0230b0f2e9b7f8b6dcb56556d15c9590c6c519.zip cpython-8d0230b0f2e9b7f8b6dcb56556d15c9590c6c519.tar.gz cpython-8d0230b0f2e9b7f8b6dcb56556d15c9590c6c519.tar.bz2 |
asyncio.subprocess: Fix a race condition in communicate()
Use self._loop instead of self._transport._loop, because transport._loop is set
to None at process exit.
Diffstat (limited to 'Lib/asyncio/subprocess.py')
-rw-r--r-- | Lib/asyncio/subprocess.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/asyncio/subprocess.py b/Lib/asyncio/subprocess.py index c3b0175..414e023 100644 --- a/Lib/asyncio/subprocess.py +++ b/Lib/asyncio/subprocess.py @@ -146,7 +146,6 @@ class Process: @tasks.coroutine def communicate(self, input=None): - loop = self._transport._loop if input: stdin = self._feed_stdin(input) else: @@ -160,7 +159,7 @@ class Process: else: stderr = self._noop() stdin, stdout, stderr = yield from tasks.gather(stdin, stdout, stderr, - loop=loop) + loop=self._loop) yield from self.wait() return (stdout, stderr) |