syncpackage: do not use bare except for urlopen()

flake8 complains:

```
./syncpackage:465:9: E722 do not use bare 'except'
```

The function `urllib.request.urlopen` might throw
`urllib.error.URLError`, `urllib.error.HTTPError`, `socket.gaierror`,
`ssl.SSLError` which are all subclasses of `OSError`.
This commit is contained in:
Benjamin Drung 2025-12-03 12:24:47 +01:00
parent c6a4c10da2
commit cf88f4b92f

View File

@ -462,7 +462,7 @@ def is_blocklisted(query):
try:
with urllib.request.urlopen(url) as f:
cached_sync_blocklist = f.read().decode("utf-8")
except:
except OSError:
print("WARNING: unable to download the sync blocklist. Erring on the side of caution.")
return ("ALWAYS", "INTERNAL ERROR: Unable to fetch sync blocklist")