Merge pull request #134 from darksidelemm/testing

Fix some Python3 compatibility issues
pull/135/head
Mark Jessop 2019-03-09 22:25:32 +10:30 zatwierdzone przez GitHub
commit 6edaa86f45
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 5 dodań i 2 usunięć

Wyświetl plik

@ -357,7 +357,7 @@ class SondeDecoder(object):
else:
try:
_telemetry = json.loads(data)
_telemetry = json.loads(data.decode('ascii'))
except Exception as e:
self.log_debug("Line could not be parsed as JSON - %s" % str(e))
return False

Wyświetl plik

@ -207,11 +207,12 @@ def detect_sonde(frequency, rs_path="./", dwell_time=10, sdr_fm='rtl_fm', device
_start = time.time()
ret_output = subprocess.check_output(rx_test_command, shell=True, stderr=FNULL)
FNULL.close()
ret_output = ret_output.decode('utf8')
except subprocess.CalledProcessError as e:
# dft_detect returns a code of 1 if no sonde is detected.
# logging.debug("Scanner - dfm_detect return code: %s" % e.returncode)
if e.returncode >= 2:
ret_output = e.output
ret_output = e.output.decode('utf8')
else:
_runtime = time.time() - _start
logging.debug("Scanner - dft_detect exited in %.1f seconds." % _runtime)

Wyświetl plik

@ -341,6 +341,8 @@ def lsusb():
FNULL = open(os.devnull, 'w')
lsusb_raw_output = subprocess.check_output(['lsusb', '-v'], stderr=FNULL)
FNULL.close()
# Convert from bytes.
lsusb_raw_output = lsusb_raw_output.decode('utf8')
except Exception as e:
logging.error("lsusb parse error - %s" % str(e))
return