Catch urlopen TypeError when context arg isn't supported.
Python changed the behavior and args for urllib.urlopen; the context arg is needed to avoid cert checking in 3.4.3 and later, but isn't supported before, where the default is to not check certs.
This commit is contained in:
parent
34afcb6504
commit
c860db13a9
@ -199,6 +199,10 @@ def available_updates():
|
|||||||
URL = ("%s/listings/addons-%s.txt" %
|
URL = ("%s/listings/addons-%s.txt" %
|
||||||
(config.get("behavior.addons-url"), lang[:2]))
|
(config.get("behavior.addons-url"), lang[:2]))
|
||||||
fp = urlopen(URL, timeout=10, context=context)
|
fp = urlopen(URL, timeout=10, context=context)
|
||||||
|
except TypeError:
|
||||||
|
URL = ("%s/listings/addons-%s.txt" %
|
||||||
|
(config.get("behavior.addons-url"), lang[:2]))
|
||||||
|
fp = urlopen(URL, timeout=10)
|
||||||
except Exception as err: # some error
|
except Exception as err: # some error
|
||||||
LOG.warning("Failed to open addon metadata for {lang} {url}: {err}".
|
LOG.warning("Failed to open addon metadata for {lang} {url}: {err}".
|
||||||
format(lang=lang, url=URL, err=err))
|
format(lang=lang, url=URL, err=err))
|
||||||
|
Loading…
Reference in New Issue
Block a user