[Pywikipedia-l] SVN: [4707] trunk/pywikipedia/testfamily.py
rotem at svn.wikimedia.org
rotem at svn.wikimedia.org
Wed Dec 12 19:45:02 UTC 2007
Revision: 4707
Author: rotem
Date: 2007-12-12 19:44:57 +0000 (Wed, 12 Dec 2007)
Log Message:
-----------
Show an error rather than crashing, if possible.
Modified Paths:
--------------
trunk/pywikipedia/testfamily.py
Modified: trunk/pywikipedia/testfamily.py
===================================================================
--- trunk/pywikipedia/testfamily.py 2007-12-12 17:53:17 UTC (rev 4706)
+++ trunk/pywikipedia/testfamily.py 2007-12-12 19:44:57 UTC (rev 4707)
@@ -80,7 +80,10 @@
else:
languages = language.split(',')
for lang in languages:
- testSite(wikipedia.getSite(lang, family))
+ try:
+ testSite(wikipedia.getSite(lang, family))
+ except KeyError:
+ wikipedia.output(u'No such language %s in family %s' % (lang, family))
if __name__ == "__main__":
try:
More information about the Pywikipedia-l
mailing list