summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/logging/handlers.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py
index b0b0a16..b2e7d44 100644
--- a/Lib/logging/handlers.py
+++ b/Lib/logging/handlers.py
@@ -518,7 +518,11 @@ class SocketHandler(logging.Handler):
else:
result = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
result.settimeout(timeout)
- result.connect(self.address)
+ try:
+ result.connect(self.address)
+ except OSError:
+ result.close() # Issue 19182
+ raise
return result
def createSocket(self):