From d41f7c3f68c72bc9e87914f3627d1d5042a81399 Mon Sep 17 00:00:00 2001 From: Vadym Stupakov Date: Sun, 9 Aug 2020 22:41:32 +0300 Subject: [PATCH] Fix for unsupported turbo (#89) * added possible fox for nit supported turbo boost --- source/core.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/source/core.py b/source/core.py index 9b376e5..3b3e322 100644 --- a/source/core.py +++ b/source/core.py @@ -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: