From 529297b97df9b9d928c30bb7cdb51f14f3fb3ab0 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 6 Apr 2011 07:37:05 -0700 Subject: usrp2_card_burner: decode byte strings into ascii for parsing --- host/utils/usrp2_card_burner.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'host/utils/usrp2_card_burner.py') diff --git a/host/utils/usrp2_card_burner.py b/host/utils/usrp2_card_burner.py index f24fc4252..741c7e3e1 100644 --- 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() + verbose = p.stdout.read().decode('ascii') if ret != 0: raise Exception(verbose) return verbose @@ -84,7 +84,7 @@ def get_raw_device_hints(): return info.split(key)[-1].split()[0] def get_info_list(output): in_info = False - for line in str(output).splitlines(): + for line in output.splitlines(): if line.startswith('\\\\'): in_info = True; info = '' elif in_info and not line.strip(): in_info = False; yield info if in_info: info += '\n'+line.strip() @@ -108,7 +108,7 @@ def get_raw_device_hints(): #################################################################### if platform.system() == 'Linux': devs = list() - try: output = open('/proc/partitions', 'r').read() + try: output = open('/proc/partitions', 'r').read().decode('ascii') except: return devs for line in output.splitlines(): try: -- cgit v1.2.3