Skip to content

Commit ef11b75

Browse files
committed
freaking network, freaking python... when it spazzes out on you, defaults to localhost for the tests
1 parent 0e4a981 commit ef11b75

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

py/test/selenium/webdriver/common/network.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ def get_interface_ip(ifname):
1919
)[20:24])
2020

2121
def get_lan_ip():
22-
ip = socket.gethostbyname(socket.gethostname())
22+
try:
23+
ip = socket.gethostbyname(socket.gethostname())
24+
except:
25+
return '0.0.0.0'
2326
if ip.startswith("127.") and os.name != "nt":
2427
interfaces = ["eth0","eth1","eth2","en0","en1","en2","en3","en4","wlan0","wlan1","wifi0","ath0","ath1","ppp0"]
2528
for ifname in interfaces:
@@ -28,4 +31,4 @@ def get_lan_ip():
2831
break
2932
except IOError:
3033
pass
31-
return ip
34+
return ip

0 commit comments

Comments
 (0)