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.
Bug: 72504 Change-Id: I1f2197ecfd014266b600ec9ff1ab7970a3634b90 --- M scripts/redirect.py 1 file changed, 11 insertions(+), 7 deletions(-)
Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified
Objections: Betacommand: There's a problem with this change, please improve
diff --git a/scripts/redirect.py b/scripts/redirect.py index 254d9a2..a1f610f 100755 --- a/scripts/redirect.py +++ b/scripts/redirect.py @@ -593,13 +593,17 @@ % targetPage.title(asLink=True)) if self.getOption('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