jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] Redirect: Allow missing toolbar example ......................................................................
[FIX] Redirect: Allow missing toolbar example
If the toolbar example message is not present the script failed.
Backported from core.
Bug: T74504 Change-Id: I2aa7bddfb1bec9e91e7a16e2dfeb47c6869d5298 --- M redirect.py 1 file changed, 11 insertions(+), 7 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/redirect.py b/redirect.py index cb26269..8b29f13 100644 --- a/redirect.py +++ b/redirect.py @@ -603,13 +603,17 @@ % targetPage.title(asLink=True)) if self.always: break # skip if automatic - mw_msg = targetPage.site.mediawiki_message( - 'wikieditor-toolbar-tool-redirect-example') - if targetPage.title() == mw_msg: - pywikibot.output( - u"Skipping toolbar example: Redirect source is " - u"potentially vandalized.") - break + try: + mw_msg = targetPage.site.mediawiki_message( + 'wikieditor-toolbar-tool-redirect-example') + except KeyError: + pass + else: + if targetPage.title() == mw_msg: + pywikibot.output( + u"Skipping toolbar example: Redirect source is " + u"potentially vandalized.") + break # watch out for redirect loops if redirList.count(u'%s:%s' % (targetPage.site.lang,
pywikibot-commits@lists.wikimedia.org