mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 06:50:29 +03:00
Don't hang or crash in checkupdates
This commit is contained in:
parent
6752665db7
commit
78aa9d1874
1 changed files with 3 additions and 1 deletions
|
|
@ -173,7 +173,7 @@ def check_market(app):
|
||||||
headers = {'User-Agent' : 'Mozilla/5.0 (X11; Linux i686; rv:18.0) Gecko/20100101 Firefox/18.0'}
|
headers = {'User-Agent' : 'Mozilla/5.0 (X11; Linux i686; rv:18.0) Gecko/20100101 Firefox/18.0'}
|
||||||
req = urllib2.Request(url, None, headers)
|
req = urllib2.Request(url, None, headers)
|
||||||
try:
|
try:
|
||||||
resp = urllib2.urlopen(req)
|
resp = urllib2.urlopen(req, None, 20)
|
||||||
except urllib2.HTTPError, e:
|
except urllib2.HTTPError, e:
|
||||||
if e.code == 404:
|
if e.code == 404:
|
||||||
return (None, 'Not in market')
|
return (None, 'Not in market')
|
||||||
|
|
@ -182,6 +182,8 @@ def check_market(app):
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
return (None, 'Failed with HTTP status' + str(req.getcode()))
|
return (None, 'Failed with HTTP status' + str(req.getcode()))
|
||||||
|
except Exception, e:
|
||||||
|
return (None, 'Failed:' + str(e))
|
||||||
page = resp.read()
|
page = resp.read()
|
||||||
|
|
||||||
version = None
|
version = None
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue