Skip to content

Commit

Permalink
Merge pull request #15 from murceca/master
Browse files Browse the repository at this point in the history
Retrieve CPU name correctly on macOS
  • Loading branch information
eterey authored Dec 21, 2017
2 parents 1c3a473 + 1591e62 commit 34454fa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion console.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from pyspectator.convert import UnitByte


clear_command = "cls" if platform.system() == "Windows" else "clear"
clear_command = 'cls' if platform.system() == 'Windows' else 'clear'


def clear():
Expand Down
6 changes: 4 additions & 2 deletions pyspectator/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,10 @@ def __get_processor_name(cls):
cpu_name = platform.processor()
elif os_name == 'Darwin':
os.environ['PATH'] = os.environ['PATH'] + os.pathsep + '/usr/sbin'
command = 'sysctl -n machdep.cpu.brand_string'
cpu_name = subprocess.check_output(command).strip()
command = ('sysctl', '-n', 'machdep.cpu.brand_string')
output = subprocess.check_output(command)
if output:
cpu_name = output.decode().strip()
elif os_name == 'Linux':
all_info = subprocess.check_output('cat /proc/cpuinfo', shell=True)
all_info = all_info.strip().split(os.linesep.encode())
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ psutil>=2.1.1
netifaces>=0.10.4
pyvalid>=0.9
pytest>=2.6.2
enum34 >= 1.0
enum34>=1.0

0 comments on commit 34454fa

Please sign in to comment.