asyncio: Close the transport on subprocess creation failure

This commit is contained in:
Victor Stinner 2015-01-15 14:24:22 +01:00
parent fcd58de78f
commit 4bf22e033e
2 changed files with 11 additions and 2 deletions

View file

@ -272,7 +272,12 @@ class ProactorEventLoop(proactor_events.BaseProactorEventLoop):
transp = _WindowsSubprocessTransport(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
return transp