jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1338029?usp=email )
Change subject: site: Cache supported CAPTCHA types
......................................................................
site: Cache supported CAPTCHA types
Change-Id: I38d1ff8dea429aed5c9bb34c4975cb84c6d86fd4
---
M pywikibot/site/_apisite.py
1 file changed, 3 insertions(+), 1 deletion(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/pywikibot/site/_apisite.py b/pywikibot/site/_apisite.py
index 79fdb19..6c3c24c 100644
--- a/pywikibot/site/_apisite.py
+++ b/pywikibot/site/_apisite.py
@@ -93,6 +93,8 @@
_mw_msg_cache: defaultdict[str, dict[str, str]] = defaultdict(dict)
+CAPTCHA_TYPES = {'math', 'simple'}
+
class _OnErrorExc(NamedTuple):
exception: Exception
@@ -2229,7 +2231,7 @@
req['captchaid'] = captcha['id']
- if captcha['type'] in ['math', 'simple']:
+ if captcha['type'] in CAPTCHA_TYPES:
req['captchaword'] = input(captcha['question'])
continue
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1338029?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I38d1ff8dea429aed5c9bb34c4975cb84c6d86fd4
Gerrit-Change-Number: 1338029
Gerrit-PatchSet: 2
Gerrit-Owner: Mahveotm <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]