jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1326331?usp=email )

Change subject: checkimages: Batch license set updates
......................................................................

checkimages: Batch license set updates

Use native set operations when excluding and adding license pages.

Avoid manual mutation loops while preserving streamed iteration.

Change-Id: I3722aac96a322956d0d5efb66ebc54034fe197ee
---
M scripts/checkimages.py
1 file changed, 5 insertions(+), 4 deletions(-)

Approvals:
  jenkins-bot: Verified
  Xqt: Looks good to me, approved




diff --git a/scripts/checkimages.py b/scripts/checkimages.py
index adc7a83..4689414 100755
--- a/scripts/checkimages.py
+++ b/scripts/checkimages.py
@@ -1120,8 +1120,7 @@
         if self.site.code == 'commons':
             no_licenses_to_skip = pywikibot.Category(self.site,
                                                      'License-related tags')
-            for license_given in no_licenses_to_skip.articles():
-                licenses.discard(license_given)
+            licenses.difference_update(no_licenses_to_skip.articles())
 
         # Add the licenses set in the default page as licenses to check
         if self.page_allowed:
@@ -1131,8 +1130,10 @@
             except (NoPageError, IsRedirectPageError):
                 pass
             else:
-                for name_license in self.load(page_allowed_text):
-                    licenses.add(pywikibot.Page(self.site, name_license))
+                licenses.update(
+                    pywikibot.Page(self.site, name_license)
+                    for name_license in self.load(page_allowed_text)
+                )

         if not licenses:
             raise pywikibot.Error(

--
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1326331?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I3722aac96a322956d0d5efb66ebc54034fe197ee
Gerrit-Change-Number: 1326331
Gerrit-PatchSet: 2
Gerrit-Owner: Mahveotm <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to