mirror of
https://github.com/python/cpython.git
synced 2025-12-11 11:31:05 +00:00
asyncio: Fix race in subprocess transport, by Victor Stinner.
This commit is contained in:
parent
efef9d3f25
commit
4835f17c24
1 changed files with 2 additions and 1 deletions
|
|
@ -160,9 +160,10 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
|
||||||
transp = _UnixSubprocessTransport(self, protocol, args, shell,
|
transp = _UnixSubprocessTransport(self, protocol, args, shell,
|
||||||
stdin, stdout, stderr, bufsize,
|
stdin, stdout, stderr, bufsize,
|
||||||
extra=None, **kwargs)
|
extra=None, **kwargs)
|
||||||
|
yield from transp._post_init()
|
||||||
watcher.add_child_handler(transp.get_pid(),
|
watcher.add_child_handler(transp.get_pid(),
|
||||||
self._child_watcher_callback, transp)
|
self._child_watcher_callback, transp)
|
||||||
yield from transp._post_init()
|
|
||||||
return transp
|
return transp
|
||||||
|
|
||||||
def _child_watcher_callback(self, pid, returncode, transp):
|
def _child_watcher_callback(self, pid, returncode, transp):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue