From 2eca07717a2ddb9440ff0e45c4420704f8995416 Mon Sep 17 00:00:00 2001 From: erpalma Date: Mon, 30 Jul 2018 10:37:20 +0200 Subject: [PATCH] fix #22 --- lenovo_fix.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lenovo_fix.py b/lenovo_fix.py index b1856cb..df0cc1a 100755 --- a/lenovo_fix.py +++ b/lenovo_fix.py @@ -38,8 +38,8 @@ def writemsr(msr, val): - n = glob.glob('/dev/cpu/[0-9]*/msr') - if not n: + n = ['/dev/cpu/{:d}/msr'.format(x) for x in range(cpu_count())] + if not os.path.exists(n[0]): try: subprocess.check_call(('modprobe', 'msr')) except subprocess.CalledProcessError: