Skip to content

Commit

Permalink
fixed binary output replacement if lspci is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
s3inlc committed Jan 27, 2018
1 parent 3a85109 commit 49041ac
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python/htpclient/initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 49041ac

Please sign in to comment.