http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9145
Revision: 9145
Author: xqt
Date: 2011-04-06 04:47:20 +0000 (Wed, 06 Apr 2011)
Log Message:
-----------
api search is disabled at wa-wiki. Raise an error which is more informative than a KeyError
Modified Paths:
--------------
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2011-04-05 12:16:17 UTC (rev 9144)
+++ trunk/pywikipedia/wikipedia.py 2011-04-06 04:47:20 UTC (rev 9145)
@@ -6013,7 +6013,10 @@
offset = 0
while offset < number or not number:
params['sroffset'] = offset
- data = query.GetData(params, self)['query']
+ data = query.GetData(params, self)
+ if 'error'in data:
+ raise NotImplementedError('%s' % data['error']['info'])
+ data = data['query']
if 'error' in data:
raise RuntimeError('%s' % data['error'])
if not data['search']: