summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 7a97c80..1bad856 100644
--- a/Lib/logging/handlers.py
+++ b/Lib/logging/handlers.py
@@ -801,7 +801,11 @@ class SysLogHandler(logging.Handler):
except socket.error:
self.socket.close()
self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
- self.socket.connect(address)
+ try:
+ self.socket.connect(address)
+ except socket.error:
+ self.socket.close()
+ raise
def encodePriority(self, facility, priority):
"""