jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1330579?usp=email )
Change subject: tools: Use isdisjoint for invisible character check
......................................................................
tools: Use isdisjoint for invisible character check
Delegate the overlap check to frozenset.isdisjoint instead of iterating
through a Python generator.
Change-Id: I4822f5f9684e7f184f712c728458166c0a0bbbbe
---
M pywikibot/tools/chars.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/tools/chars.py b/pywikibot/tools/chars.py
index 9ed74f1..c49d8a4 100644
--- a/pywikibot/tools/chars.py
+++ b/pywikibot/tools/chars.py
@@ -24,7 +24,7 @@
def contains_invisible(text):
"""Return True if the text contain any of the invisible characters."""
- return any(char in _invisible_chars for char in text)
+ return not _invisible_chars.isdisjoint(text)
def replace_invisible(text):
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1330579?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: I4822f5f9684e7f184f712c728458166c0a0bbbbe
Gerrit-Change-Number: 1330579
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]