http://www.mediawiki.org/wiki/Special:Code/pywikipedia/8942
Revision: 8942 Author: russblau Date: 2011-02-08 19:56:10 +0000 (Tue, 08 Feb 2011) Log Message: ----------- further fixes to exception handling
Modified Paths: -------------- branches/rewrite/scripts/redirect.py
Modified: branches/rewrite/scripts/redirect.py =================================================================== --- branches/rewrite/scripts/redirect.py 2011-02-08 17:05:32 UTC (rev 8941) +++ branches/rewrite/scripts/redirect.py 2011-02-08 19:56:10 UTC (rev 8942) @@ -472,11 +472,16 @@ pywikibot.output( u'Warning: Redirect target section %s doesn't exist.' % newRedir.title(asLink=True)) + except pywikibot.CircularRedirect, e: + pywikibot.warning(u"Skipping circular redirect: [[%s]]" + % str(e)) + break except pywikibot.BadTitle, e: # str(e) is in the format 'BadTitle: [[Foo]]' pywikibot.output( u'Warning: Redirect target %s is not a valid page title.' % str(e)[10:]) + break except pywikibot.NoPage: if len(redirList) == 1: pywikibot.output(u'Skipping: Page %s does not exist.'