Skip to content

Commit

Permalink
environment: some CPU vendors might not expose a model name, but use …
Browse files Browse the repository at this point in the history
…the BIOS model name

Introduce a fallback so that CPU name detection still works.

Change-Id: If759bd561415eb765ec0e96ce75ec63e4e222ff1
  • Loading branch information
anisse committed Oct 31, 2024
1 parent 2e1e697 commit 41e5a57
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hwbench/environment/cpu_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down

0 comments on commit 41e5a57

Please sign in to comment.