Fix for unsupported turbo (#89)

* added possible fox for nit supported turbo boost
This commit is contained in:
Vadym Stupakov 2020-08-09 22:41:32 +03:00 committed by GitHub
parent 6d1cce4620
commit da7ab203a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -42,14 +42,18 @@ def turbo(value: bool = None):
f = cpufreq
inverse = False
else:
print("Error: cpu boost is not available")
return None
print("Warning: CPU turbo is not available")
return False
if value is not None:
if inverse:
value = not value
f.write_text(str(int(value)) + "\n")
try:
f.write_text(str(int(value)) + "\n")
except PermissionError:
print("Warning: Changing CPU turbo is not supported. Skipping.")
return False
value = bool(int(f.read_text().strip()))
if inverse: