Do not crash in case of connection failure

Return None to indicate a network failure.
master
Salvo 'LtWorf' Tomaselli 2016-03-21 14:40:23 +07:00
parent cf2115b383
commit f12e35fef9
1 changed files with 5 additions and 2 deletions

@ -51,8 +51,11 @@ def check_latest_version():
Heavely dependent on server and server configurations Heavely dependent on server and server configurations
not granted to work forever.''' not granted to work forever.'''
connection = http.client.HTTPConnection('feedback-ltworf.appspot.com') connection = http.client.HTTPConnection('feedback-ltworf.appspot.com')
connection.request("GET", "/version/relational") try:
r = connection.getresponse() connection.request("GET", "/version/relational")
r = connection.getresponse()
except:
return None
# html # html
s = r.read() s = r.read()