[projects/pld-builder.new] builder: stop shadowing outer names in loops

arekm arekm at pld-linux.org
Wed Aug 12 11:45:46 CEST 2026


commit 9951f5d0c2bffb8a659768341d42e0e87ea9614e
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Wed Aug 12 09:26:06 2026 +0200

    builder: stop shadowing outer names in loops
    
    Two loops rebound a name that already meant something in the same function.

 PLD_Builder/acl.py             | 10 +++++-----
 PLD_Builder/request_handler.py |  6 +++---
 2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/PLD_Builder/acl.py b/PLD_Builder/acl.py
index 75c3c7b..70faf1e 100644
--- a/PLD_Builder/acl.py
+++ b/PLD_Builder/acl.py
@@ -36,14 +36,14 @@ class User:
             self.change_requester = True
 
         if p.has_option(login, "privs"):
-            for p in p.get(login, "privs").split():
-                l = p.split(":")
+            for priv in p.get(login, "privs").split():
+                l = priv.split(":")
                 if len(l) == 2:
-                    p+=":*"
+                    priv+=":*"
                 if len(l) not in (2,3) or l[0] == "" or l[1] == "":
-                    log.panic("acl: invalid priv format: '%s' [%s]" % (p, login))
+                    log.panic("acl: invalid priv format: '%s' [%s]" % (priv, login))
                 else:
-                    self.privs.append(p)
+                    self.privs.append(priv)
         else:
             log.panic("acl: [%s] has no privs" % login)
 
diff --git a/PLD_Builder/request_handler.py b/PLD_Builder/request_handler.py
index 74c7f1c..9c67769 100644
--- a/PLD_Builder/request_handler.py
+++ b/PLD_Builder/request_handler.py
@@ -155,9 +155,9 @@ def handle_notification(r, user):
     q.read()
     not_fin = list(filter(lambda r: not r.is_done(), q.requests))
     r.apply_to(q)
-    for r in not_fin:
-        if r.is_done():
-            util.clean_tmp(path.srpms_dir + '/' + r.id)
+    for req in not_fin:
+        if req.is_done():
+            util.clean_tmp(path.srpms_dir + '/' + req.id)
     now = time.time()
     def leave_it(r):
         # for ,,done'' set timeout to 4d
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/pld-builder.new.git/commitdiff/44916a7a9112928736ec2b65b4fa58a90bc5828c



More information about the pld-cvs-commit mailing list