summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/unix_events.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/asyncio/unix_events.py')
-rw-r--r--Lib/asyncio/unix_events.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/asyncio/unix_events.py b/Lib/asyncio/unix_events.py
index 1fbdd31..230fbc3 100644
--- a/Lib/asyncio/unix_events.py
+++ b/Lib/asyncio/unix_events.py
@@ -223,6 +223,9 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
raise OSError(errno.EADDRINUSE, msg) from None
else:
raise
+ except:
+ sock.close()
+ raise
else:
if sock is None:
raise ValueError(