diff options
author | Josh Blum <josh@joshknows.com> | 2012-04-18 15:08:45 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2012-04-18 15:08:45 -0700 |
commit | 5ebbf8a887c33c5afbae3f135e48bab0574396bc (patch) | |
tree | 562408a5a9eaf3dd8a090285b0f1f727592c024a /host | |
parent | 4a1ec80d496e7754cf5a8c0f96322b2871094a31 (diff) | |
download | uhd-5ebbf8a887c33c5afbae3f135e48bab0574396bc.tar.gz uhd-5ebbf8a887c33c5afbae3f135e48bab0574396bc.tar.bz2 uhd-5ebbf8a887c33c5afbae3f135e48bab0574396bc.zip |
n2x0: card burner fixes for python3.0 and IPv6
has_key is not in python3.0, use key in dict
put try catch around interface enumeration, might be an ipv6 issue
Diffstat (limited to 'host')
-rwxr-xr-x | host/utils/usrp_n2xx_net_burner.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/host/utils/usrp_n2xx_net_burner.py b/host/utils/usrp_n2xx_net_burner.py index ae6219524..6d1c02712 100755 --- a/host/utils/usrp_n2xx_net_burner.py +++ b/host/utils/usrp_n2xx_net_burner.py @@ -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: |