Skip to content

Commit

Permalink
Tolerate Python < 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky committed Sep 16, 2024
1 parent 8c11fd1 commit f0de201
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/test_urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
import os
from urllib.error import HTTPError, URLError

# from urllib.error import HTTPError, URLError
from urllib.request import urlopen

import pytest
Expand All @@ -26,5 +27,6 @@ def test_yaml_urls():
html = response.read()
assert html, f"should have been able to get HTML for {k} ({url})"
print(f"got {k}")
except* (URLError, HTTPError):
# except* (URLError, HTTPError): # for when we have 3.11+
except Exception:
assert False, f"{k} ({url}) fails"

0 comments on commit f0de201

Please sign in to comment.