Skip to content

Commit 8a65e51

Browse files
committed
verifybinaries: catch the correct exception
1 parent 4b23b48 commit 8a65e51

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

contrib/verifybinaries/verify.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import tempfile
4141
import textwrap
4242
import urllib.request
43+
import urllib.error
4344
import enum
4445
from hashlib import sha256
4546
from pathlib import PurePath, Path
@@ -126,7 +127,7 @@ def download_lines_with_urllib(url) -> t.Tuple[bool, t.List[str]]:
126127
try:
127128
return (True, [
128129
line.strip().decode() for line in urllib.request.urlopen(url).readlines()])
129-
except urllib.request.HTTPError as e:
130+
except urllib.error.HTTPError as e:
130131
log.warning(f"HTTP request to {url} failed (HTTPError): {e}")
131132
except Exception as e:
132133
log.warning(f"HTTP request to {url} failed ({e})")

0 commit comments

Comments
 (0)