Add missing identifiers for urllib exception handling.

This commit is contained in:
Walter Lapchynski 2018-10-15 21:20:25 -07:00
parent 8d0c107a0f
commit 3915c9a26f
2 changed files with 10 additions and 4 deletions

View File

@ -90,10 +90,10 @@ def getcountry():
try:
with urllib.request.urlopen(geoipurl, timeout=75) as url:
localedata = json.loads(url.read().decode())
except HTTPError:
except HTTPError as error:
logging.error("Data of %s not retrieved because %s - URL: %s",
name, error, url)
except URLError:
except URLError as error:
if isinstance(error.reason, socket.timeout):
logging.error("Socket timed out - URL %s", url)
else:
@ -108,10 +108,10 @@ def getmirror(country):
try:
with urllib.request.urlopen(mirrorlisturl, timeout=75) as url:
mirrors = json.loads(url.read().decode())
except HTTPError:
except HTTPError as error:
logging.error("Data of %s not retrieved because %s - URL: %s",
name, error, url)
except URLError:
except URLError as error:
if isinstance(error.reason, socket.timeout):
logging.error("Socket timed out - URL %s", url)
else:

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
calamares-settings-ubuntu (27) cosmic; urgency=medium
* Add missing identifiers for urllib exception handling.
-- Walter Lapchynski <wxl@ubuntu.com> Mon, 15 Oct 2018 21:01:34 -0700
calamares-settings-ubuntu (26) cosmic; urgency=medium
* Lubuntu: fix check for EFI architecture.