[Concept,07/29] buildman: Fix minor pylint warnings in builder.py

Message ID 20260106220403.2915630-8-sjg@u-boot.org
State New
Headers
Series buildman: Clean up builder.py |

Commit Message

Simon Glass Jan. 6, 2026, 10:03 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

- Use .items() when iterating over dict in Config.__hash__()
- Use clear() instead of iterating over a list in __del__()

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 tools/buildman/builder.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
  

Patch

diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index 1c6a38b232e..46ef4bca33f 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -141,8 +141,8 @@  class Config:
 
     def __hash__(self):
         val = 0
-        for fname in self.config:
-            for key, value in self.config[fname].items():
+        for fname, config in self.config.items():
+            for key, value in config.items():
                 print(key, value)
                 val = val ^ hash(key) & hash(value)
         return val
@@ -415,8 +415,7 @@  class Builder:
 
     def __del__(self):
         """Get rid of all threads created by the builder"""
-        for t in self.threads:
-            del t
+        self.threads.clear()
 
     def signal_handler(self, signal, frame):
         sys.exit(1)