Revision: 4581 Author: btongminh Date: 2007-11-21 10:16:22 +0000 (Wed, 21 Nov 2007)
Log Message: ----------- Fix UnboundLocalError
Modified Paths: -------------- trunk/pywikipedia/login.py
Modified: trunk/pywikipedia/login.py =================================================================== --- trunk/pywikipedia/login.py 2007-11-21 09:50:45 UTC (rev 4580) +++ trunk/pywikipedia/login.py 2007-11-21 10:16:22 UTC (rev 4581) @@ -156,9 +156,9 @@ captchaR = re.compile('<input type="hidden" name="wpCaptchaId" id="wpCaptchaId" value="(?P<id>\d+)" />') match = captchaR.search(data) if match: + id = match.group('id') if not config.solve_captcha: raise wikipedia.CaptchaError(id) - id = match.group('id') url = self.site.protocol() + '://' + self.site.hostname() + self.site.captcha_image_address(id) answer = wikipedia.ui.askForCaptcha(url) return self.getCookie(remember = remember, captchaId = id, captchaAnswer = answer)