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: