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

Change subject: site: Avoid building namespace overlap sets
......................................................................

site: Avoid building namespace overlap sets

Use isdisjoint in categorymembers to check whether the requested
namespaces overlap the excluded namespaces. This avoids constructing
an intersection set when only the presence of an overlap is needed.

Preserve the existing validation error and category member arguments.

Change-Id: I9ce57f11ba2c97a153c30c9201952c9678482ae1
---
M pywikibot/site/_generators.py
1 file changed, 1 insertion(+), 1 deletion(-)

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




diff --git a/pywikibot/site/_generators.py b/pywikibot/site/_generators.py
index 695cf77..2dea689 100644
--- a/pywikibot/site/_generators.py
+++ b/pywikibot/site/_generators.py
@@ -697,7 +697,7 @@
                     excluded_namespaces.add(14)

                 if namespaces:
-                    if excluded_namespaces.intersection(namespaces):
+                    if not excluded_namespaces.isdisjoint(namespaces):
                         raise ValueError(
                             f'incompatible namespaces {namespaces!r} and '
                             f'member_type {member_type!r}')

--
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1345267?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: I9ce57f11ba2c97a153c30c9201952c9678482ae1
Gerrit-Change-Number: 1345267
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