[Pywikipedia-svn] SVN: [7267] trunk/pywikipedia/wikipedia.py

alexsh at svn.wikimedia.org alexsh at svn.wikimedia.org
Thu Sep 17 15:31:43 UTC 2009


Revision: 7267
Author:   alexsh
Date:     2009-09-17 15:31:42 +0000 (Thu, 17 Sep 2009)

Log Message:
-----------
Site().mediawiki_message(): Fix KeyError in API Mode

Modified Paths:
--------------
    trunk/pywikipedia/wikipedia.py

Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py	2009-09-17 15:21:20 UTC (rev 7266)
+++ trunk/pywikipedia/wikipedia.py	2009-09-17 15:31:42 UTC (rev 7267)
@@ -5384,12 +5384,7 @@
                     try:
                         datas = query.GetData(params, self)['query']['allmessages']
                         self._mediawiki_messages = _dict([(tag['name'].lower(), tag['*'])
-                                for tag in datas])
-                    except KeyError:
-                        if verbose:
-                            output('API get messages had some error, retrying by ordinary.')
-                        api = False
-                        continue
+                                for tag in datas if not tag.has_key('missing')])
                     except NotImplementedError:
                         api = False
                         continue





More information about the Pywikipedia-svn mailing list