Fix issue about var 'conn' not being defined

This commit is contained in:
Alexandre Aubin 2020-09-20 19:18:50 +02:00
parent e7bf7580c1
commit 462cf09587

View file

@ -243,7 +243,8 @@ def urlopen(url):
except urllib.error.HTTPError as e: except urllib.error.HTTPError as e:
return {'content': '', 'code': e.code} return {'content': '', 'code': e.code}
except urllib.error.URLError as e: except urllib.error.URLError as e:
_print('URLError') _print('Could not fetch %s : %s' % (url, e))
return {'content': '', 'code': 0}
return {'content': conn.read().decode('UTF8'), 'code': 200} return {'content': conn.read().decode('UTF8'), 'code': 200}