http://www.mediawiki.org/wiki/Special:Code/pywikipedia/8840
Revision: 8840
Author: xqt
Date: 2011-01-16 15:14:37 +0000 (Sun, 16 Jan 2011)
Log Message:
-----------
check if the subkey exists anyway
Modified Paths:
--------------
branches/rewrite/pywikibot/i18n.py
Modified: branches/rewrite/pywikibot/i18n.py
===================================================================
--- branches/rewrite/pywikibot/i18n.py 2011-01-16 14:52:17 UTC (rev 8839)
+++ branches/rewrite/pywikibot/i18n.py 2011-01-16 15:14:37 UTC (rev 8840)
@@ -174,10 +174,11 @@
if hasattr(code,'lang'):
code = code.lang
- if code in xdict:
+ # check if the subkey exists anyway
+ if code in xdict and xdict[code]:
return xdict[code]
for alt in _altlang(code):
- if alt in xdict:
+ if alt in xdict and xdict[alt]:
return xdict[alt]
if '_default' in xdict:
return xdict['_default']
_______________________________________________
Pywikipedia-svn mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-svn