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

alexsh at svn.wikimedia.org alexsh at svn.wikimedia.org
Mon Sep 21 14:06:43 UTC 2009


Revision: 7283
Author:   alexsh
Date:     2009-09-21 14:06:42 +0000 (Mon, 21 Sep 2009)

Log Message:
-----------
Site().solveCaptcha(): fix if result had error code and info only

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

Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py	2009-09-21 10:37:31 UTC (rev 7282)
+++ trunk/pywikipedia/wikipedia.py	2009-09-21 14:06:42 UTC (rev 7283)
@@ -4848,7 +4848,8 @@
 
     def solveCaptcha(self, data):
         if type(data) == dict: # API Mode result
-            data = data['edit']
+            if data.has_key('edit') and  data['edit']['result'] != u"Success":
+                data = data['edit']
             if data.has_key("captcha"):
                 data = data['captcha']
                 captype = data['type']





More information about the Pywikipedia-svn mailing list