summaryrefslogtreecommitdiffstats
path: root/Lib/logging/handlers.py
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2012-06-25 22:20:27 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2012-06-25 22:20:27 (GMT)
commita57a8e072c8a6f6c5b71abaf245892977ee372dc (patch)
tree00103f4081e8fe306cc31c99e19200cdcb7976bf /Lib/logging/handlers.py
parent0b1b9ce494ee91ed525a83b802e15cd9a03922d5 (diff)
parent3e6d71d3360f2b8dd0232b492d0a63cc6b5419d3 (diff)
downloadcpython-a57a8e072c8a6f6c5b71abaf245892977ee372dc.zip
cpython-a57a8e072c8a6f6c5b71abaf245892977ee372dc.tar.gz
cpython-a57a8e072c8a6f6c5b71abaf245892977ee372dc.tar.bz2
Closes #15179: Merged fix from 3.2.
Diffstat (limited to 'Lib/logging/handlers.py')
-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):
"""