summaryrefslogtreecommitdiff
path: root/asyncio/windows_events.py
diff options
context:
space:
mode:
Diffstat (limited to 'asyncio/windows_events.py')
-rw-r--r--asyncio/windows_events.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/asyncio/windows_events.py b/asyncio/windows_events.py
index 9d496f2..82d0966 100644
--- a/asyncio/windows_events.py
+++ b/asyncio/windows_events.py
@@ -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