Matěj Suchánek has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/324474

Change subject: Use sub on compiled regex
......................................................................

Use sub on compiled regex

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


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/74/324474/2

diff --git a/pywikibot/cosmetic_changes.py b/pywikibot/cosmetic_changes.py
index 76bea75..1ef96e5 100755
--- a/pywikibot/cosmetic_changes.py
+++ b/pywikibot/cosmetic_changes.py
@@ -531,8 +531,7 @@
             # instead of a pipelink
             elif (len(titleWithSection) <= len(label) and
                   label[:len(titleWithSection)] == titleWithSection and
-                  re.sub(trailR, '',
-                         label[len(titleWithSection):]) == ''):
+                  trailR.sub('', label[len(titleWithSection):]) == ''):
                 newLink = "[[%s]]%s" % (label[:len(titleWithSection)],
                                         label[len(titleWithSection):])
             else:

-- 
To view, visit https://gerrit.wikimedia.org/r/324474
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib551d6132b60f7a1817983e13549f9f9005ec92b
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Matěj Suchánek <matejsuchane...@gmail.com>
Gerrit-Reviewer: Dalba <dalba.w...@gmail.com>
Gerrit-Reviewer: Magul <tomasz.magul...@gmail.com>
Gerrit-Reviewer: Xqt <i...@gno.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to