summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/windows_events.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-01-15 13:24:22 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-01-15 13:24:22 (GMT)
commit4bf22e033e975f61c33752db5a3764dc0f7d0b03 (patch)
tree268ed6b1243135e2b55cad6d59907a0ca33e5ae5 /Lib/asyncio/windows_events.py
parentfcd58de78f72ca114707b78e448397d6dbe2ad5d (diff)
downloadcpython-4bf22e033e975f61c33752db5a3764dc0f7d0b03.zip
cpython-4bf22e033e975f61c33752db5a3764dc0f7d0b03.tar.gz
cpython-4bf22e033e975f61c33752db5a3764dc0f7d0b03.tar.bz2
asyncio: Close the transport on subprocess creation failure
Diffstat (limited to 'Lib/asyncio/windows_events.py')
-rw-r--r--Lib/asyncio/windows_events.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/asyncio/windows_events.py b/Lib/asyncio/windows_events.py
index 9d496f2..82d0966 100644
--- a/Lib/asyncio/windows_events.py
+++ b/Lib/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