Skip to content

Commit 398220f

Browse files
committed
Use 127.0.0.1 as localhost name resolving might fail on some systems
1 parent b92eeb4 commit 398220f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

py/selenium/webdriver/common/utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def is_connectable(port):
4040
try:
4141
socket_ = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
4242
socket_.settimeout(1)
43-
socket_.connect(("localhost", port))
43+
socket_.connect(("127.0.0.1", port))
4444
socket_.close()
4545
return True
4646
except socket.error:
@@ -60,7 +60,7 @@ def is_url_connectable(port):
6060
import urllib2 as url_request
6161

6262
try:
63-
res = url_request.urlopen("http://localhost:%s/status" % port)
63+
res = url_request.urlopen("http://127.0.0.1:%s/status" % port)
6464
if res.getcode() == 200:
6565
return True
6666
else:

0 commit comments

Comments
 (0)