Entropy/RepoInterface:

- fix internet connection check


git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@2096 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
lxnay
2008-06-03 09:33:34 +00:00
parent ce02cde735
commit d09b55decd
+7 -2
View File
@@ -149,8 +149,13 @@ def get_remote_data(url):
socket.setdefaulttimeout(60)
# now pray the server
try:
if etpConst['proxy']:
proxy_support = urllib2.ProxyHandler(etpConst['proxy'])
mydict = {}
if etpConst['proxy']['ftp']:
mydict['ftp'] = etpConst['proxy']['ftp']
if etpConst['proxy']['http']:
mydict['http'] = etpConst['proxy']['http']
if mydict:
proxy_support = urllib2.ProxyHandler(mydict)
opener = urllib2.build_opener(proxy_support)
urllib2.install_opener(opener)
item = urllib2.urlopen(url)