Commit 3e6d71d3 authored by Vinay Sajip's avatar Vinay Sajip

Issue #15179: Closed socket on connection failure. Thanks to Kazutaka Morita for the patch.

parent 1dd75a64
......@@ -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):
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment