Bugfix for py-cpuinfo with some CPUs and Py versions

Python 3.11, on a 7B12, returns brand instead of brand_raw. Use this to ensure we don't error out, but also be resiliant to secondary definitions
This commit is contained in:
andrew committed 2023-06-11 03:59:08 -04:00
1 parent bc93df2538
commit 1ed71cb4a9
1 file changed
+1 -1
+1 -1
View File
@@ -178,7 +178,7 @@ def scan_for_cpu_flags(data):
# Set the CPU name which has to be done via global
global SYSTEM_CPU_NAME, SYSTEM_CPU_FLAGS
SYSTEM_CPU_NAME = info['brand_raw']
SYSTEM_CPU_NAME = info.get('brand_raw', info.get('brand', 'Unknown'))
# This should cover virtually all compiler flags that we would care about
desired = ['POPCNT', 'BMI2']