From 92e34f4880ba033ea83409fd3cd5166ecfeba8c0 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Fri, 16 Oct 2015 14:13:45 -0700 Subject: max287x: assert target_freq --- host/lib/usrp/common/max287x.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/host/lib/usrp/common/max287x.hpp b/host/lib/usrp/common/max287x.hpp index fe5da195c..3d43802c8 100644 --- a/host/lib/usrp/common/max287x.hpp +++ b/host/lib/usrp/common/max287x.hpp @@ -434,6 +434,7 @@ double max287x::set_frequency( bool feedback_divided = (_regs.feedback_select == max287x_regs_t::FEEDBACK_SELECT_DIVIDED); //increase RF divider until acceptable VCO frequency (MIN freq for MAX287x VCO is 3GHz) + UHD_ASSERT_THROW(target_freq > 0); double vco_freq = target_freq; while (vco_freq < MIN_VCO_FREQ) { -- cgit v1.2.3 From ec9ce22775468d48766463a1f38d3d83fd0a1775 Mon Sep 17 00:00:00 2001 From: Marcus Müller Date: Sat, 17 Oct 2015 12:13:17 +0200 Subject: utils: Added pre-API change python request compatibility Affects the uhd_images_downloader utility. Older versions of requests didn't know the "stream" kwarg. Added a compatibility fallback. --- host/utils/uhd_images_downloader.py.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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: -- cgit v1.2.3