diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2020-01-12 07:45:16 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2020-01-12 07:47:06 +0100 |
commit | 2292db10fce04fcca3efb806f9a578ad38166e18 (patch) | |
tree | 6629e5053db0dc0fd5afb754934a70fbba9c5f69 /dlpcvp.py | |
parent | 3178e4bd3a868f78ce9f1765e9562524e674307d (diff) | |
download | dlp_check_version_PyPI-2292db10fce04fcca3efb806f9a578ad38166e18.tar.gz |
Catch URLError when accessing network.
Diffstat (limited to 'dlpcvp.py')
-rwxr-xr-x | dlpcvp.py | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -11,7 +11,7 @@ import urllib.request import xml.etree.ElementTree as ET from distutils.version import LooseVersion from typing import Iterable, List, Optional, Tuple, Union -from urllib.error import HTTPError +from urllib.error import URLError, HTTPError from urllib.request import Request, urlopen # PyPI API documentation https://warehouse.readthedocs.io/api-reference/ @@ -303,6 +303,11 @@ def main(prj): except RuntimeError as ex: log.warning(f'Package {pkg} cannot be found: {ex}') continue + except URLError as ex: + log.warning( + 'Investigation of package %s caused network error: %s', + pkg, ex) + continue try: if pypi_ver > suse_ver: |