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 b6e1cc3a59
commit d41f7c3f68

View File

@ -42,14 +42,18 @@ def turbo(value: bool = None):
f = cpufreq f = cpufreq
inverse = False inverse = False
else: else:
print("Error: cpu boost is not available") print("Warning: CPU turbo is not available")
return None return False
if value is not None: if value is not None:
if inverse: if inverse:
value = not value 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())) value = bool(int(f.read_text().strip()))
if inverse: if inverse: