diff options
Diffstat (limited to 'host/utils')
-rwxr-xr-x | host/utils/usrp2_card_burner.py | 2 | ||||
-rwxr-xr-x | host/utils/usrp_n2xx_net_burner.py | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/host/utils/usrp2_card_burner.py b/host/utils/usrp2_card_burner.py index 34c40d5a0..02d5c4b18 100755 --- a/host/utils/usrp2_card_burner.py +++ b/host/utils/usrp2_card_burner.py @@ -50,7 +50,7 @@ def command(*args): stderr=subprocess.STDOUT, ) ret = p.wait() - verbose = p.stdout.read().decode() + verbose = p.stdout.read().decode('utf-8', errors='ignore') if ret != 0: raise Exception(verbose) return verbose diff --git a/host/utils/usrp_n2xx_net_burner.py b/host/utils/usrp_n2xx_net_burner.py index 31c94405b..6d1c02712 100755 --- a/host/utils/usrp_n2xx_net_burner.py +++ b/host/utils/usrp_n2xx_net_burner.py @@ -134,7 +134,7 @@ def command(*args): stderr=subprocess.STDOUT, ) ret = p.wait() - verbose = p.stdout.read().decode() + verbose = p.stdout.read().decode('utf-8', errors='ignore') if ret != 0: raise Exception(verbose) return verbose @@ -196,8 +196,10 @@ def win_get_interfaces(): adNode = a.ipAddressList while True: #convert ipAddr and ipMask into hex addrs that can be turned into a bcast addr - ipAddr = adNode.ipAddress.decode() - ipMask = adNode.ipMask.decode() + try: + ipAddr = adNode.ipAddress.decode() + ipMask = adNode.ipMask.decode() + except AttributeError: pass if ipAddr and ipMask: hexAddr = struct.unpack("<L", socket.inet_aton(ipAddr))[0] hexMask = struct.unpack("<L", socket.inet_aton(ipMask))[0] @@ -282,7 +284,7 @@ class burner_socket(object): (flash_size, sector_size) = self.get_flash_info() hw_rev = self.get_hw_rev() - if n2xx_revs.has_key(hw_rev): print("Hardware type: %s" % n2xx_revs[hw_rev][0]) + if hw_rev in n2xx_revs: print("Hardware type: %s" % n2xx_revs[hw_rev][0]) print("Flash size: %i\nSector size: %i\n" % (flash_size, sector_size)) if fpga: |