We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b7f21d3 commit c02cf56Copy full SHA for c02cf56
py/selenium/webdriver/common/utils.py
@@ -147,8 +147,8 @@ def is_url_connectable(
147
- scheme - URL scheme
148
"""
149
try:
150
- res = urllib.request.urlopen(f"{scheme}://{host}:{port}/status")
151
- return res.getcode() == 200
+ with urllib.request.urlopen(f"{scheme}://{host}:{port}/status") as res:
+ return res.getcode() == 200
152
except Exception:
153
return False
154
0 commit comments