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

Change subject: IMPR: get regex from textlib in CosmeticChangesToolkit
......................................................................

IMPR: get regex from textlib in CosmeticChangesToolkit

Change-Id: I176a06be2773901ee7f611aa7e4be28bbd466661
---
M pywikibot/cosmetic_changes.py
1 file changed, 1 insertion(+), 3 deletions(-)

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




diff --git a/pywikibot/cosmetic_changes.py b/pywikibot/cosmetic_changes.py
index 2d87ed6..467734c 100644
--- a/pywikibot/cosmetic_changes.py
+++ b/pywikibot/cosmetic_changes.py
@@ -518,9 +518,7 @@

         cache: dict[bool | str, Any] = {}
         exceptions = ['comment', 'nowiki', 'pre', 'syntaxhighlight']
-        regex = re.compile(
-            textlib.FILE_LINK_REGEX % '|'.join(self.site.namespaces[6]),
-            flags=re.VERBOSE)
+        regex = textlib.get_regexes('file', self.site)[0]
         return textlib.replaceExcept(
             text, regex, replace_magicword, exceptions)


--
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1195833?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: I176a06be2773901ee7f611aa7e4be28bbd466661
Gerrit-Change-Number: 1195833
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[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