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

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

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

Use sub on compiled regex

This reimplements Ib551d6132b60f7a1817983e13549f9f9005ec92b.

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


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/43/324743/2

diff --git a/pywikibot/cosmetic_changes.py b/pywikibot/cosmetic_changes.py
index 1a90183..6f4bfac 100755
--- a/pywikibot/cosmetic_changes.py
+++ b/pywikibot/cosmetic_changes.py
@@ -521,8 +521,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/324743
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1f433c0f8a9c2d454206902f75cf6303b7d4f918
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Matěj Suchánek <matejsuchane...@gmail.com>

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

Reply via email to