mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
asyncio: Close the transport on subprocess creation failure
This commit is contained in:
parent
fcd58de78f
commit
4bf22e033e
2 changed files with 11 additions and 2 deletions
|
@ -177,7 +177,11 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
|
|||
transp = _UnixSubprocessTransport(self, protocol, args, shell,
|
||||
stdin, stdout, stderr, bufsize,
|
||||
extra=extra, **kwargs)
|
||||
yield from transp._post_init()
|
||||
try:
|
||||
yield from transp._post_init()
|
||||
except:
|
||||
transp.close()
|
||||
raise
|
||||
watcher.add_child_handler(transp.get_pid(),
|
||||
self._child_watcher_callback, transp)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue