aboutsummaryrefslogtreecommitdiffstats
path: root/mpm
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2018-02-07 13:59:23 -0800
committerMartin Braun <martin.braun@ettus.com>2018-02-07 13:59:23 -0800
commit88ab35529b5be85654b4b00cd558bc083b692df4 (patch)
tree6031543272688c7b82b225ffd3ef669a7b4a9f28 /mpm
parent0d73d8ab817ed0e0e1578d26fff98201b2cff961 (diff)
downloaduhd-88ab35529b5be85654b4b00cd558bc083b692df4.tar.gz
uhd-88ab35529b5be85654b4b00cd558bc083b692df4.tar.bz2
uhd-88ab35529b5be85654b4b00cd558bc083b692df4.zip
fixup! mpm: Fixup for argument parsing in N310
Diffstat (limited to 'mpm')
-rw-r--r--mpm/python/usrp_mpm/mpmutils.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/mpm/python/usrp_mpm/mpmutils.py b/mpm/python/usrp_mpm/mpmutils.py
index 08eb54798..1e4f49b54 100644
--- a/mpm/python/usrp_mpm/mpmutils.py
+++ b/mpm/python/usrp_mpm/mpmutils.py
@@ -141,4 +141,12 @@ def assert_compat_number(
return
def str2bool(value):
- return value.lower() in ("yes", "true", "t", "1")
+ """Return a Boolean value from a string, even if the string is not simply
+ 'True' or 'False'. For non-string values, this will do a simple default
+ coercion to bool.
+ """
+ try:
+ return value.lower() in ("yes", "true", "t", "1")
+ except AttributeError:
+ return bool(value)
+