Revision: 4093 Author: btongminh Date: 2007-08-23 13:08:10 +0000 (Thu, 23 Aug 2007)
Log Message: ----------- Give a more specific error if a namespace does not exist.
Modified Paths: -------------- trunk/pywikipedia/family.py
Modified: trunk/pywikipedia/family.py =================================================================== --- trunk/pywikipedia/family.py 2007-08-23 08:30:49 UTC (rev 4092) +++ trunk/pywikipedia/family.py 2007-08-23 13:08:10 UTC (rev 4093) @@ -2226,7 +2226,7 @@
def namespace(self, code, ns_number, fallback = '_default', all = False): if not self.isDefinedNS(ns_number): - raise KeyError('ERROR: Unknown namespace %d' % ns_number) + raise KeyError('ERROR: Unknown namespace %d for %s:%s' % (ns_number, code, self.name)) elif self.isNsI18N(ns_number, code): v = self.namespaces[ns_number][code] elif fallback:
pywikipedia-l@lists.wikimedia.org