Skip to content

Commit

Permalink
Cleanup of lscpu brand checking.
Browse files Browse the repository at this point in the history
  • Loading branch information
workhorsy committed Feb 1, 2021
1 parent d7a4065 commit 4abfc0a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cpuinfo/cpuinfo.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: UTF-8 -*-

# Copyright (c) 2014-2020 Matthew Brennan Jones <[email protected]>
# Copyright (c) 2014-2021 Matthew Brennan Jones <[email protected]>
# Py-cpuinfo gets CPU info with pure Python 2 & 3
# It uses the MIT License
# It is hosted at: https://github.com/workhorsy/py-cpuinfo
Expand Down Expand Up @@ -1877,6 +1877,10 @@ def _get_cpu_info_from_lscpu():
brand = _get_field(False, output, None, None, 'Model name')
if brand:
info['brand_raw'] = brand
else:
brand = _get_field(False, output, None, None, 'Model')
if brand and not brand.isdigit():
info['brand_raw'] = brand

family = _get_field(False, output, None, None, 'CPU family')
if family and family.isdigit():
Expand All @@ -1889,8 +1893,6 @@ def _get_cpu_info_from_lscpu():
model = _get_field(False, output, None, None, 'Model')
if model and model.isdigit():
info['model'] = int(model)
elif not brand:
info['brand_raw'] = model

l1_data_cache_size = _get_field(False, output, None, None, 'L1d cache')
if l1_data_cache_size:
Expand Down

0 comments on commit 4abfc0a

Please sign in to comment.