http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9337
Revision: 9337 Author: xqt Date: 2011-07-09 09:23:24 +0000 (Sat, 09 Jul 2011) Log Message: ----------- breaks if page is deleted in browser and continues with next page (fix for bug #3356607 submitted by Bin?\195?\161ris)
Modified Paths: -------------- trunk/pywikipedia/replace.py
Modified: trunk/pywikipedia/replace.py =================================================================== --- trunk/pywikipedia/replace.py 2011-07-06 20:13:40 UTC (rev 9336) +++ trunk/pywikipedia/replace.py 2011-07-09 09:23:24 UTC (rev 9337) @@ -436,7 +436,12 @@ page.site().nice_get_address(page.title()) )) pywikibot.input("Press Enter when finished in browser.") - original_text = page.get(get_redirect=True, force=True) + try: + original_text = page.get(get_redirect=True, force=True) + except pywikibot.NoPage: + pywikibot.output(u'Page %s has been deleted.' + % page.title()) + break new_text = original_text continue if choice == 'q':
pywikipedia-svn@lists.wikimedia.org