improved code by mypy advice
This commit is contained in:
+4
-1
@@ -1,6 +1,6 @@
|
||||
from app_class import AppClass
|
||||
from config import Config
|
||||
from cpufreq import cpuFreq, cpufreq
|
||||
from cpufreq import cpuFreq, cpufreq # type: ignore
|
||||
from functools import cached_property
|
||||
from mapping import governor_priority_mapping
|
||||
from exceptions import GovernorNotFound
|
||||
@@ -46,6 +46,9 @@ class Governor(AppClass):
|
||||
self.log.warning("application is running in testmode, cpu governor not set")
|
||||
return None
|
||||
|
||||
if self._cpufreq is None:
|
||||
return None
|
||||
|
||||
if governor_name not in self._cpufreq.available_governors:
|
||||
self.log.error("governor %s not supported by cpu", governor_name)
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user