jenkins-bot has submitted this change and it was merged.
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(-)
Approvals: Dalba: Looks good to me, approved jenkins-bot: Verified
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:
pywikibot-commits@lists.wikimedia.org