From: Guido van Rossum Date: Fri, 10 Jan 2014 21:28:59 +0000 (-0800) Subject: asyncio: Fix race in subprocess transport, by Victor Stinner. X-Git-Tag: v3.4.0b3~185 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4835f17c247cc9687c59f2faa6f69573f90d876e;p=python asyncio: Fix race in subprocess transport, by Victor Stinner. --- diff --git a/Lib/asyncio/unix_events.py b/Lib/asyncio/unix_events.py index eb3fb9f91c..80a98f806e 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):