Revision: 8573
Author: xqt
Date: 2010-09-19 12:30:58 +0000 (Sun, 19 Sep 2010)
Log Message:
-----------
bugfix for exception handling. Use an error class derived from BaseException since we use
new-style classes for errors.
Modified Paths:
--------------
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2010-09-17 23:43:47 UTC (rev 8572)
+++ trunk/pywikipedia/wikipedia.py 2010-09-19 12:30:58 UTC (rev 8573)
@@ -6484,7 +6484,7 @@
print 'DEBUG allpages>>> data.keys()', data.keys()
if 'warnings' in data:
warning = data['warnings']['allpages']['*']
- raise str(warning)
+ raise RuntimeError("API query warning: %s" % warning)
if 'error' in data:
raise RuntimeError("API query error: %s" % data)
if not 'allpages' in data['query']:
Show replies by date