diff options
author | Guido van Rossum <guido@python.org> | 2014-01-10 21:28:59 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2014-01-10 21:28:59 (GMT) |
commit | 4835f17c247cc9687c59f2faa6f69573f90d876e (patch) | |
tree | d892806efee6795730f93a25d3d7b361548726ce | |
parent | efef9d3f25b5070a6430259fd3b5703e94c7843d (diff) | |
download | cpython-4835f17c247cc9687c59f2faa6f69573f90d876e.zip cpython-4835f17c247cc9687c59f2faa6f69573f90d876e.tar.gz cpython-4835f17c247cc9687c59f2faa6f69573f90d876e.tar.bz2 |
asyncio: Fix race in subprocess transport, by Victor Stinner.
-rw-r--r-- | Lib/asyncio/unix_events.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/asyncio/unix_events.py b/Lib/asyncio/unix_events.py index eb3fb9f..80a98f8 100644 --- a/Lib/asyncio/unix_events.py +++ b/Lib/asyncio/unix_events.py @@ -160,9 +160,10 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop): transp = _UnixSubprocessTransport(self, protocol, args, shell, stdin, stdout, stderr, bufsize, extra=None, **kwargs) + yield from transp._post_init() watcher.add_child_handler(transp.get_pid(), self._child_watcher_callback, transp) - yield from transp._post_init() + return transp def _child_watcher_callback(self, pid, returncode, transp): |