summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-02-20 09:12:59 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-02-20 09:12:59 (GMT)
commitcdb476bd438c7befec98913a6f1e770edd2f11a8 (patch)
tree4a70fbd9b013a6f587dff484dcb37ac9008f6d9b /Lib/asyncio
parent88a928b6142c0ab3a9ab799b1652bb6d64e7face (diff)
downloadcpython-cdb476bd438c7befec98913a6f1e770edd2f11a8.zip
cpython-cdb476bd438c7befec98913a6f1e770edd2f11a8.tar.gz
cpython-cdb476bd438c7befec98913a6f1e770edd2f11a8.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')
-rw-r--r--Lib/asyncio/subprocess.py3
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)