Don't fail if can't create a socket to check master connection.

This happens for instance if ipv6 is disabled in the kernel but
/etc/hosts contains both ipv4 and ipv6 records for 'localhost'.
This commit is contained in:
Dmitry Kuzmenko 2017-06-08 17:49:25 +03:00
parent ea656e92c6
commit 44e2ad24df

View File

@ -793,8 +793,8 @@ def dns_check(addr, port, safe=False, ipv6=None):
if h[0] != socket.AF_INET6 or ipv6 is not None:
candidates.append(candidate_addr)
s = socket.socket(h[0], socket.SOCK_STREAM)
try:
s = socket.socket(h[0], socket.SOCK_STREAM)
s.connect((candidate_addr.strip('[]'), port))
s.close()