asyncio: Fix race in subprocess transport, by Victor Stinner.

This commit is contained in:
Guido van Rossum 2014-01-10 13:28:59 -08:00
parent efef9d3f25
commit 4835f17c24
1 changed files with 2 additions and 1 deletions

View File

@ -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):