From 6ea82449063587100d38c6e8bd8a8a6c4f99422b Mon Sep 17 00:00:00 2001 From: Ariel Otilibili Date: Sat, 9 Nov 2024 12:21:07 +0100 Subject: [PATCH] `make lint` in `glances/cpu_percent.py` Signed-off-by: Ariel Otilibili --- glances/cpu_percent.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/glances/cpu_percent.py b/glances/cpu_percent.py index 0f76e7d8..5a9d5fbf 100644 --- a/glances/cpu_percent.py +++ b/glances/cpu_percent.py @@ -8,7 +8,7 @@ """CPU percent stats shared between CPU and Quicklook plugins.""" -from typing import List, Optional, TypedDict +from typing import Optional, TypedDict import psutil @@ -121,7 +121,7 @@ class CpuPercent: def _compute_cpu() -> float: return psutil.cpu_percent(interval=0.0) - def get_percpu(self) -> List[PerCpuPercentInfo]: + def get_percpu(self) -> list[PerCpuPercentInfo]: """Update and/or return the per CPU list using the psutil library.""" # Never update more than 1 time per cached_timer_cpu if self.timer_percpu.finished(): @@ -131,7 +131,7 @@ class CpuPercent: self.percpu_percent = self._compute_percpu() return self.percpu_percent - def _compute_percpu(self) -> List[PerCpuPercentInfo]: + def _compute_percpu(self) -> list[PerCpuPercentInfo]: psutil_percpu = enumerate(psutil.cpu_times_percent(interval=0.0, percpu=True)) return [ {