Kaydet (Commit) 8d0230b0 authored tarafından Victor Stinner's avatar Victor Stinner

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.
üst a96ed63d
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment