[Patchew-devel] [PATCH v2 01/11] testing: Avoid masking out outter iterator r

Fam Zheng famz at redhat.com
Fri Jul 27 03:59:24 UTC 2018


The 'r' we want to yield is the object in queryset. Avoid overwriting it
with a requirement string.

Signed-off-by: Fam Zheng <famz at redhat.com>
---
 mods/testing.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mods/testing.py b/mods/testing.py
index 0a80b3d..70b4674 100644
--- a/mods/testing.py
+++ b/mods/testing.py
@@ -409,8 +409,8 @@ class TestingGetView(APILoginRequiredView):
             if not t:
                 continue
             reqs = t.get("requirements", "")
-            for r in [x.strip() for x in reqs.split(",") if x]:
-                if r not in capabilities:
+            for req in [x.strip() for x in reqs.split(",") if x]:
+                if req not in capabilities:
                     break
             else:
                 yield r, t
-- 
2.17.1




More information about the Patchew-devel mailing list