Skip to content

Commit

Permalink
OnBehalf of 'sun void': make it so ResourceWarning isn't generated at…
Browse files Browse the repository at this point in the history
… all

Fixes google code issue 5923
  • Loading branch information
lukeis committed Apr 12, 2015
1 parent 60f377d commit d23f680
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions py/selenium/webdriver/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ def is_connectable(port):
socket_ = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
socket_.settimeout(1)
socket_.connect(("127.0.0.1", port))
socket_.close()
return True
result = True
except socket.error:
return False
result = False
finally:
socket_.close()
return result

def is_url_connectable(port):
"""
Expand Down

0 comments on commit d23f680

Please sign in to comment.