From 41e5a57a42ea20fc90a1211a44505fe3e9a0dc82 Mon Sep 17 00:00:00 2001 From: Anisse Astier Date: Thu, 31 Oct 2024 11:55:20 +0100 Subject: [PATCH] environment: some CPU vendors might not expose a model name, but use the BIOS model name Introduce a fallback so that CPU name detection still works. Change-Id: If759bd561415eb765ec0e96ce75ec63e4e222ff1 --- hwbench/environment/cpu_info.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hwbench/environment/cpu_info.py b/hwbench/environment/cpu_info.py index 027d75c..c931070 100644 --- a/hwbench/environment/cpu_info.py +++ b/hwbench/environment/cpu_info.py @@ -60,7 +60,10 @@ def get_model(self) -> int: return int(self._mandatory_spec("Model")) def get_model_name(self) -> str: - return self._mandatory_spec("Model name") + try: + return self._mandatory_spec("Model name") + except ValueError as _: + return self._mandatory_spec("BIOS Model name") def get_stepping(self) -> int: return int(self._mandatory_spec("Stepping"))