[Python-checkins] cpython (3.4): asyncio.subprocess: Fix a race condition in communicate()

larry.hastings python-checkins at python.org
Mon Mar 17 07:32:28 CET 2014


http://hg.python.org/cpython/rev/aa0043256457
changeset: 89746:aa0043256457
branch: 3.4
user: Victor Stinner <victor.stinner at gmail.com>
date: Thu Feb 20 10:12:59 2014 +0100
summary:
 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.
files:
 Lib/asyncio/subprocess.py | 3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/Lib/asyncio/subprocess.py b/Lib/asyncio/subprocess.py
--- a/Lib/asyncio/subprocess.py
+++ b/Lib/asyncio/subprocess.py
@@ -146,7 +146,6 @@
 
 @tasks.coroutine
 def communicate(self, input=None):
- loop = self._transport._loop
 if input:
 stdin = self._feed_stdin(input)
 else:
@@ -160,7 +159,7 @@
 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)
 
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /