jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/584634 )
Change subject: [bugfix] Bail out early if login in progress ......................................................................
[bugfix] Bail out early if login in progress
...as LoginManager handles API errors itself.
Bug: T248768 Change-Id: I4c7eae246a08ca86d92b7fde29689dc70af20126 --- M pywikibot/data/api.py 1 file changed, 4 insertions(+), 3 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py index 9ca7b81..917287a 100644 --- a/pywikibot/data/api.py +++ b/pywikibot/data/api.py @@ -1898,8 +1898,7 @@
def _bad_token(self, code): """Check for bad token.""" - if (code != 'badtoken' or self.site._loginstatus - == pywikibot.site.LoginStatus.IN_PROGRESS): + if code != 'badtoken': return False
user_tokens = self.site.tokens._tokens[self.site.user()] @@ -1973,7 +1972,9 @@
self._handle_warnings(result)
- if 'error' not in result: + # LoginManager handles errors on its own + if ('error' not in result or self.site._loginstatus + == pywikibot.site.LoginStatus.IN_PROGRESS): return result
error = result['error'].copy()
pywikibot-commits@lists.wikimedia.org