From 1375573a46b7322114023f62cddc0b194c68d82c Mon Sep 17 00:00:00 2001 From: Ariel Otilibili Date: Thu, 29 May 2025 13:39:51 +0200 Subject: [PATCH] glances: remove iterator helpers No more needed in Python 3. Following commit 72e1511d ("globals: Fix a race condition in namedtuple_to_dict"), the dynamic view on the keys is as well transformed into a list. Related to #3181 --- glances/processes.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/glances/processes.py b/glances/processes.py index c2174319..973c650a 100644 --- a/glances/processes.py +++ b/glances/processes.py @@ -17,7 +17,6 @@ from glances.globals import ( MACOS, WINDOWS, dictlist_first_key_value, - iterkeys, list_of_namedtuple_to_list_of_dict, namedtuple_to_dict, ) @@ -157,7 +156,7 @@ class GlancesProcesses: self.processcount['pid_max'] = self.pid_max # For each key in the processcount dict # count the number of processes with the same status - for k in iterkeys(self.processcount): + for k in list(self.processcount.keys()): self.processcount[k] = len(list(filter(lambda v: v.get('status', '?') is k, plist))) # Compute thread try: