Revision: 6253 Author: cydeweys Date: 2009-01-14 02:45:23 +0000 (Wed, 14 Jan 2009)
Log Message: ----------- Fixing a minor bug where the CFDbot did not catch the NoPage exception while attempting to figure out the date link on a CFD, so it was not able to empty out redlinked categories.
Modified Paths: -------------- trunk/pywikipedia/cfd.py
Modified: trunk/pywikipedia/cfd.py =================================================================== --- trunk/pywikipedia/cfd.py 2009-01-13 14:05:52 UTC (rev 6252) +++ trunk/pywikipedia/cfd.py 2009-01-14 02:45:23 UTC (rev 6253) @@ -119,8 +119,12 @@ # per-day subheadings on the working page. def findDay(pageTitle, oldDay): page = wikipedia.Page(wikipedia.getSite(), "Category:" + pageTitle) - pageSrc = page.get() - m = findday.search(pageSrc) + try: + pageSrc = page.get() + m = findday.search(pageSrc) + except wikipedia.NoPage: + m = None + if (m != None): return "[[" + m.group(1) + "]]" else:
pywikipedia-l@lists.wikimedia.org