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

Change subject: editor: Check control characters with isdisjoint
......................................................................

editor: Check control characters with isdisjoint

Check detected Windows editor commands against the control-character
set with isdisjoint. Avoid constructing a set of the command characters
and an intersection set when only the presence of a match is needed.

Preserve editor selection and the warning for escaped characters.

Change-Id: Ib31fddd072d195fcfaf7b6012eaa635497a2b7f1
---
M pywikibot/editor.py
1 file changed, 1 insertion(+), 1 deletion(-)

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




diff --git a/pywikibot/editor.py b/pywikibot/editor.py
index 7f2d13d..fe656e2 100644
--- a/pywikibot/editor.py
+++ b/pywikibot/editor.py
@@ -204,7 +204,7 @@
                     if unusable in editor.lower():
                         break
                 else:
-                    if set(editor) & set('\a\b\f\n\r\t\v'):
+                    if not set('\a\b\f\n\r\t\v').isdisjoint(editor):
                         # single character string literals from
                         # 
https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals
                         # encode('unicode-escape') also changes Unicode

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