mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
make update check more fault tolerant
This commit is contained in:
parent
b12460f225
commit
0f3ad34af2
1 changed files with 6 additions and 5 deletions
|
@ -50,12 +50,13 @@ class LatestVersionFinder(QThread):
|
||||||
d = urllib.urlencode(d)
|
d = urllib.urlencode(d)
|
||||||
try:
|
try:
|
||||||
f = urllib2.urlopen(baseUrl + "getQtVersion", d)
|
f = urllib2.urlopen(baseUrl + "getQtVersion", d)
|
||||||
except (urllib2.URLError, httplib.BadStatusLine):
|
|
||||||
return
|
|
||||||
resp = f.read()
|
resp = f.read()
|
||||||
if not resp:
|
if not resp:
|
||||||
return
|
return
|
||||||
resp = simplejson.loads(resp)
|
resp = simplejson.loads(resp)
|
||||||
|
except:
|
||||||
|
# behind proxy, corrupt message, etc
|
||||||
|
return
|
||||||
if resp['latestVersion'] > ankiqt.appVersion:
|
if resp['latestVersion'] > ankiqt.appVersion:
|
||||||
self.emit(SIGNAL("newVerAvail"), resp)
|
self.emit(SIGNAL("newVerAvail"), resp)
|
||||||
diff = resp['currentTime'] - time.time()
|
diff = resp['currentTime'] - time.time()
|
||||||
|
|
Loading…
Reference in a new issue