Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0364d00

Browse files
committed
Handle timeout errors.
1 parent 53e161c commit 0364d00

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

check_versions.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ def search_sphinx_versions_in_cpython(repo: git.Repo):
7777

7878
async def get_version_in_prod(language, version):
7979
url = f"https://docs.python.org/{language}/{version}".replace("/en/", "/")
80-
response = await httpx.get(url, timeout=5)
80+
try:
81+
response = await httpx.get(url, timeout=5)
82+
except httpx.exceptions.TimeoutException:
83+
return "TIMED OUT"
8184
text = response.text.encode("ASCII", errors="ignore").decode("ASCII")
8285
if created_using := re.search(
8386
r"sphinx.pocoo.org.*?([0-9.]+[0-9])", text, flags=re.M

0 commit comments

Comments
 (0)