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 22f8c34..d4df5c6 100644
--- a/Lib/logging/handlers.py
+++ b/Lib/logging/handlers.py
@@ -761,7 +761,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):
"""