jenkins-bot has submitted this change and it was merged.
Change subject: Simplify replaceExcept predefined exceptions ......................................................................
Simplify replaceExcept predefined exceptions
- fix spelling mistake - simplify format string - remove recheck of else clause
Change-Id: I82f4ad991fad98df5decd02ccb869a617353bf2d --- M pywikibot/textlib.py 1 file changed, 3 insertions(+), 4 deletions(-)
Approvals: Mpaa: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py index 4492d8c..e186cbe 100644 --- a/pywikibot/textlib.py +++ b/pywikibot/textlib.py @@ -281,11 +281,10 @@ else: result.append(_regex_cache[exc]) else: - # nowiki, noinclude, includeonly, timeline, math ond other + # nowiki, noinclude, includeonly, timeline, math and other # extensions - if exc not in _regex_cache: - _regex_cache[exc] = re.compile(r'(?is)<%s>.*?</%s>' - % (exc, exc)) + _regex_cache[exc] = re.compile( + r'(?is)<{0}>.*?</{0}>'.format(exc)) result.append(_regex_cache[exc]) # handle alias if exc == 'source':
pywikibot-commits@lists.wikimedia.org