Commit e9514b87 authored by Giampaolo Rodola's avatar Giampaolo Rodola

merge heads

parents b28e0942 b37cd392
......@@ -446,8 +446,12 @@ class SocketHandler(logging.Handler):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
if hasattr(s, 'settimeout'):
s.settimeout(timeout)
s.connect((self.host, self.port))
return s
try:
s.connect((self.host, self.port))
return s
except socket.error:
s.close()
raise
def createSocket(self):
"""
......@@ -469,9 +473,6 @@ class SocketHandler(logging.Handler):
self.retryTime = None # next time, no delay before trying
except socket.error:
#Creation failed, so set the retry time and return.
if self.sock is not None:
self.sock.close()
self.sock = None
if self.retryTime is None:
self.retryPeriod = self.retryStart
else:
......
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