From e0561641f6d801d4f37d28bc578e0cec6681f4fc Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Tue, 18 May 2021 00:21:48 +0200 Subject: Converted from subprocess.check_output() to SysCommand() to hide cpu_vendor() output. --- archinstall/lib/hardware.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'archinstall/lib/hardware.py') diff --git a/archinstall/lib/hardware.py b/archinstall/lib/hardware.py index f527b5da..8009e708 100644 --- a/archinstall/lib/hardware.py +++ b/archinstall/lib/hardware.py @@ -98,11 +98,12 @@ def has_intel_graphics() -> bool: def cpu_vendor() -> Optional[str]: - cpu_info = json.loads(subprocess.check_output("lscpu -J", shell=True).decode('utf-8'))['lscpu'] + cpu_info_raw = SysCommand("lscpu -J") + cpu_info = json.loads(b"".join(cpu_info_raw).decode('UTF-8'))['lscpu'] + for info in cpu_info: - if info.get('field', None): - if info.get('field', None) == "Vendor ID:": - return info.get('data', None) + if info.get('field', None) == "Vendor ID:": + return info.get('data', None) return None -- cgit v1.2.3-70-g09d2