Skip to content

Commit

Permalink
Use 127.0.0.1 as localhost name resolving might fail on some systems
Browse files Browse the repository at this point in the history
  • Loading branch information
andreastt committed Jun 18, 2014
1 parent b92eeb4 commit 398220f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions py/selenium/webdriver/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def is_connectable(port):
try:
socket_ = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
socket_.settimeout(1)
socket_.connect(("localhost", port))
socket_.connect(("127.0.0.1", port))
socket_.close()
return True
except socket.error:
Expand All @@ -60,7 +60,7 @@ def is_url_connectable(port):
import urllib2 as url_request

try:
res = url_request.urlopen("http://localhost:%s/status" % port)
res = url_request.urlopen("http://127.0.0.1:%s/status" % port)
if res.getcode() == 200:
return True
else:
Expand Down

0 comments on commit 398220f

Please sign in to comment.