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