[fix] Catch ConnectionError from requests package

This commit is contained in:
Jérôme Lebleu 2015-02-23 11:01:09 +01:00
parent 4c83f2c89d
commit 37d12f964f

View file

@ -194,7 +194,7 @@ def tools_maindomain(auth, old_domain=None, new_domain=None, dyndns=False):
if dyndns and len(new_domain.split('.')) >= 3:
try:
r = requests.get('https://dyndns.yunohost.org/domains')
except ConnectionError:
except requests.ConnectionError:
pass
else:
dyndomains = json.loads(r.text)
@ -232,7 +232,7 @@ def tools_postinstall(domain, password, ignore_dyndns=False):
if len(domain.split('.')) >= 3 and not ignore_dyndns:
try:
r = requests.get('https://dyndns.yunohost.org/domains')
except ConnectionError:
except requests.ConnectionError:
pass
else:
dyndomains = json.loads(r.text)