[rtems-source-builder commit] sb: Update the downloader for 2.7.8 and earlier without a context.

Chris Johns chrisj at rtems.org
Mon Mar 30 03:31:39 UTC 2015


Module:    rtems-source-builder
Branch:    master
Commit:    bd16849b11c8422cccaa52500b7badb9c6dd7086
Changeset: http://git.rtems.org/rtems-source-builder/commit/?id=bd16849b11c8422cccaa52500b7badb9c6dd7086

Author:    Chris Johns <chrisj at rtems.org>
Date:      Mon Mar 30 14:30:56 2015 +1100

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

---

 source-builder/sb/download.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/source-builder/sb/download.py b/source-builder/sb/download.py
index 032e3ae..5622d4a 100644
--- a/source-builder/sb/download.py
+++ b/source-builder/sb/download.py
@@ -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')




More information about the vc mailing list