From 49041ac2534defb37f8251189efa316fe737fbab Mon Sep 17 00:00:00 2001 From: Sein Coray Date: Sat, 27 Jan 2018 18:51:32 +0100 Subject: [PATCH] fixed binary output replacement if lspci is not found --- python/htpclient/initialize.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python/htpclient/initialize.py b/python/htpclient/initialize.py index 5a23f75..49bbd7c 100644 --- a/python/htpclient/initialize.py +++ b/python/htpclient/initialize.py @@ -66,7 +66,11 @@ def __update_information(self): if len(line) == 0: continue devices.append(line.replace("Model name:", "").strip("\r\n ")) - output = subprocess.check_output("lspci | grep 'VGA compatible controller'", shell=True) + try: + output = subprocess.check_output("lspci | grep 'VGA compatible controller'", shell=True) + except subprocess.CalledProcessError: + # we silently ignore this case on machines where lspci is not present or architecture has no pci bus + output = b"" output = output.decode(encoding='utf-8').replace("\r\n", "\n").split("\n") for line in output: if len(line) == 0: