mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 23:07:59 +01:00
verifybinaries: catch the correct exception
This commit is contained in:
parent
4b23b488d2
commit
8a65e5145c
1 changed files with 2 additions and 1 deletions
|
@ -40,6 +40,7 @@ import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
import textwrap
|
import textwrap
|
||||||
import urllib.request
|
import urllib.request
|
||||||
|
import urllib.error
|
||||||
import enum
|
import enum
|
||||||
from hashlib import sha256
|
from hashlib import sha256
|
||||||
from pathlib import PurePath, Path
|
from pathlib import PurePath, Path
|
||||||
|
@ -126,7 +127,7 @@ def download_lines_with_urllib(url) -> t.Tuple[bool, t.List[str]]:
|
||||||
try:
|
try:
|
||||||
return (True, [
|
return (True, [
|
||||||
line.strip().decode() for line in urllib.request.urlopen(url).readlines()])
|
line.strip().decode() for line in urllib.request.urlopen(url).readlines()])
|
||||||
except urllib.request.HTTPError as e:
|
except urllib.error.HTTPError as e:
|
||||||
log.warning(f"HTTP request to {url} failed (HTTPError): {e}")
|
log.warning(f"HTTP request to {url} failed (HTTPError): {e}")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.warning(f"HTTP request to {url} failed ({e})")
|
log.warning(f"HTTP request to {url} failed ({e})")
|
||||||
|
|
Loading…
Add table
Reference in a new issue