Revision: 4140 Author: cydeweys Date: 2007-08-30 01:34:57 +0000 (Thu, 30 Aug 2007)
Log Message: ----------- Committing a quick fix to catch the NoPage exceptions caught when working on a red category page. Red categories can still contain pages in them, so we should not abort.
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2007-08-29 22:11:40 UTC (rev 4139) +++ trunk/pywikipedia/wikipedia.py 2007-08-30 01:34:57 UTC (rev 4140) @@ -1331,7 +1331,11 @@ The return value is a list of Category objects, one for each of the category links in the page text. """ - return getCategoryLinks(self.get(nofollow_redirects=nofollow_redirects), self.site()) + try: + category_links_to_return = getCategoryLinks(self.get(nofollow_redirects=nofollow_redirects), self.site()) + except NoPage: + category_links_to_return = [] + return category_links_to_return
def __cmp__(self, other): """Pseudo method to be able to use equality and inequality tests on
pywikipedia-l@lists.wikimedia.org