Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix pint/(X instances) cache error #8

Merged
merged 1 commit into from
Oct 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions system_query/cpu_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ def _get_cache_size(level: int, cpuinfo_data: dict) -> t.Optional[int]:
if raw_value is None:
return None
assert isinstance(raw_value, str), (type(raw_value), raw_value)
# Sometimes cpuinfo prints e.g. `192 KiB (6 instances)` so we use
# just the first two words
raw_value = " ".join(raw_value.split()[:2])
# KB, MB: "this practice frequently leads to confusion and is deprecated"
# see https://en.wikipedia.org/wiki/JEDEC_memory_standards
if raw_value.endswith('KB'):
Expand Down