diff options
| author | Martin Braun <martin.braun@ettus.com> | 2015-10-19 17:33:20 -0700 | 
|---|---|---|
| committer | Martin Braun <martin.braun@ettus.com> | 2015-10-19 17:33:20 -0700 | 
| commit | 6dbda9edcd02842506341b50566076f8b0a79f8b (patch) | |
| tree | 5d091d99ab23a3e984d528d2b31a76c980e5f938 /host/utils | |
| parent | 508311768ad4f9538eecda16f1cae899ea31184b (diff) | |
| parent | ec9ce22775468d48766463a1f38d3d83fd0a1775 (diff) | |
| download | uhd-6dbda9edcd02842506341b50566076f8b0a79f8b.tar.gz uhd-6dbda9edcd02842506341b50566076f8b0a79f8b.tar.bz2 uhd-6dbda9edcd02842506341b50566076f8b0a79f8b.zip | |
Merge branch 'maint'
Diffstat (limited to 'host/utils')
| -rw-r--r-- | host/utils/uhd_images_downloader.py.in | 6 | 
1 files changed, 5 insertions, 1 deletions
| diff --git a/host/utils/uhd_images_downloader.py.in b/host/utils/uhd_images_downloader.py.in index e0375fb43..7a3ff8ddf 100644 --- a/host/utils/uhd_images_downloader.py.in +++ b/host/utils/uhd_images_downloader.py.in @@ -77,7 +77,11 @@ class uhd_images_downloader():      def download(self, images_url, filename, buffer_size=_DEFAULT_BUFFER_SIZE, print_progress=False):          """ Run the download, show progress """ -        r = requests.get(images_url, stream=True, headers={'User-Agent': 'UHD Images Downloader'}) +        try: +            r = requests.get(images_url, stream=True, headers={'User-Agent': 'UHD Images Downloader'}) +        except TypeError as te: +            ## requests library versions pre-4c3b9df6091b65d8c72763222bd5fdefb7231149 (Dec.'12) workaround +            r = requests.get(images_url, prefetch=False, headers={'User-Agent': 'UHD Images Downloader'})          filesize = float(r.headers['content-length'])          filesize_dl = 0          with open(filename, "wb") as f: | 
