##// END OF EJS Templates
catch socket.error in utils.localinterfaces...
MinRK -
Show More
@@ -31,7 +31,7 b' from .data import uniq_stable'
31 LOCAL_IPS = []
31 LOCAL_IPS = []
32 try:
32 try:
33 LOCAL_IPS = socket.gethostbyname_ex('localhost')[2]
33 LOCAL_IPS = socket.gethostbyname_ex('localhost')[2]
34 except socket.gaierror:
34 except socket.error:
35 pass
35 pass
36
36
37 PUBLIC_IPS = []
37 PUBLIC_IPS = []
@@ -41,7 +41,7 b' try:'
41 # try hostname.local, in case hostname has been short-circuited to loopback
41 # try hostname.local, in case hostname has been short-circuited to loopback
42 if not hostname.endswith('.local') and all(ip.startswith('127') for ip in PUBLIC_IPS):
42 if not hostname.endswith('.local') and all(ip.startswith('127') for ip in PUBLIC_IPS):
43 PUBLIC_IPS = socket.gethostbyname_ex(socket.gethostname() + '.local')[2]
43 PUBLIC_IPS = socket.gethostbyname_ex(socket.gethostname() + '.local')[2]
44 except socket.gaierror:
44 except socket.error:
45 pass
45 pass
46 else:
46 else:
47 PUBLIC_IPS = uniq_stable(PUBLIC_IPS)
47 PUBLIC_IPS = uniq_stable(PUBLIC_IPS)
General Comments 0
You need to be logged in to leave comments. Login now