Skip to content

Commit

Permalink
timeout if no answer
Browse files Browse the repository at this point in the history
Adding the timeout argument to requests.get() to avoid potentially indefinite hang.
  • Loading branch information
perolavsvendsen authored May 24, 2023
1 parent 851c965 commit d06ea00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zwiz/_hs3data.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def __init__(
# When testing, html is passed as a string to create a controlled environment
if html is None:
url = f"http://{ip}:{port}/{page}"
response = requests.get(url)
response = requests.get(url, timeout=10)
if not response.ok:
raise IOError("Could not grab the page from HS3.")
html = response.text
Expand Down

0 comments on commit d06ea00

Please sign in to comment.