增加windows 实现 (#671)

增加Windows CPU信息获取
This commit is contained in:
FangYin Cheng 2023-10-13 23:27:51 +08:00 committed by GitHub
commit 867c2f2ea4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -205,8 +205,14 @@ def get_cpu_info():
except:
pass
elif os_type == OSType.WINDOWS:
# TODO
raise NotImplementedError
try:
output = subprocess.check_output("wmic cpu get Name", shell=True).decode(
"utf-8"
)
lines = output.splitlines()
cpu_info = lines[2].split(":")[-1].strip()
except:
pass
return os_type, avx_type, cpu_info, distribution