diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-01-14 22:44:41 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-01-14 22:44:41 +0100 |
commit | 03aa11c221465f30dc9386f9e172ef3b2c9b0586 (patch) | |
tree | ffa5d154ec4e5cb062fe41bfdfe77bb7b684afe7 /asyncio | |
parent | 9c3c28069fb91d0bf63d02cf3ac62a9aa9046af7 (diff) | |
download | trollius-03aa11c221465f30dc9386f9e172ef3b2c9b0586.tar.gz |
Fix BaseEventLoop._create_connection_transport()
Close the transport if the creation of the transport (if the waiter) gets an
exception.
Diffstat (limited to 'asyncio')
-rw-r--r-- | asyncio/base_events.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/asyncio/base_events.py b/asyncio/base_events.py index 35c8d74..5df5b83 100644 --- a/asyncio/base_events.py +++ b/asyncio/base_events.py @@ -634,7 +634,12 @@ class BaseEventLoop(events.AbstractEventLoop): else: transport = self._make_socket_transport(sock, protocol, waiter) - yield from waiter + try: + yield from waiter + except Exception as exc: + transport.close() + raise + return transport, protocol @coroutine |