http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11093
Revision: 11093 Author: amir Date: 2013-02-20 10:52:44 +0000 (Wed, 20 Feb 2013) Log Message: ----------- fixing r11090 using noPage error
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2013-02-20 09:35:13 UTC (rev 11092) +++ trunk/pywikipedia/wikipedia.py 2013-02-20 10:52:44 UTC (rev 11093) @@ -4289,7 +4289,7 @@ data['query'] = {'pages': data['entities']} for pageid in data['entities'].keys(): if pageid == "-1": - raise RuntimeError("API query error, no pages found: %s" % data) + raise NoPage(self.site(), unicode(self),"API query error, no pages found: %s" % data) params1['titles'] = pageid ndata=query.GetData(params1, self.site(), sysop=sysop) data['entities'].update(ndata['query']['pages']) @@ -4297,7 +4297,7 @@ if 'error' in data: raise RuntimeError("API query error: %s" % data) if not 'pages' in data['query']: - raise RuntimeError("API query error, no pages found: %s" % data) + raise NoPage(self.site(), unicode(self),"API query error, no pages found: %s" % data) pageInfo = ndata['query']['pages'].values()[0] if data['query']['pages'].keys()[0] == "-1": if 'missing' in pageInfo:
pywikipedia-svn@lists.wikimedia.org