sb: Update the downloader for 2.7.8 and earlier without a context.

This commit is contained in:
Chris Johns 2015-03-30 14:30:56 +11:00
parent 3237c8ee69
commit bd16849b11

View File

@ -328,9 +328,11 @@ def _http_downloader(url, local, config, opts):
try:
import ssl
_ssl_context = ssl._create_unverified_context()
_in = urllib2.urlopen(url, context = _ssl_context)
except:
pass
_in = urllib2.urlopen(url, context = _ssl_context)
_ssl_context = None
if _ssl_context is None:
_in = urllib2.urlopen(url)
if url != _in.geturl():
log.notice(' redirect: %s' % (_in.geturl()))
_out = open(path.host(local), 'wb')