Revision: 8130 Author: xqt Date: 2010-04-26 07:33:31 +0000 (Mon, 26 Apr 2010)
Log Message: ----------- Fix for getmagicwords('defaultsort') returns None
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2010-04-26 07:17:17 UTC (rev 8129) +++ trunk/pywikipedia/wikipedia.py 2010-04-26 07:33:31 UTC (rev 8130) @@ -2354,12 +2354,14 @@ continue # {{DEFAULTSORT:...}} defaultKeys = self.site().getmagicwords('defaultsort') - found = False - for key in defaultKeys: - if name.startswith(key): - found = True - break - if found: continue + # It seems some wikis does not have this magic key + if defaultKeys: + found = False + for key in defaultKeys: + if name.startswith(key): + found = True + break + if found: continue
try: name = Page(self.site(), name).title()