jenkins-bot has submitted this change and it was merged.
Change subject: (bug 64997) Bugfix - Note: self.limit could be -1 ......................................................................
(bug 64997) Bugfix - Note: self.limit could be -1
Partly revert of https://gerrit.wikimedia.org/r/#/c/130019/ testing of bool(self.limit) is True when it is -1. We have to check whether self.limit > 0
Change-Id: If25add4c3ba7892416195337d5a79993baf6d0d9 --- M pywikibot/data/api.py 1 file changed, 2 insertions(+), 1 deletion(-)
Approvals: Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py index de2865e..1a85255 100644 --- a/pywikibot/data/api.py +++ b/pywikibot/data/api.py @@ -760,7 +760,8 @@ # otherwise we proceed as usual else: count += 1 - if self.limit and count >= self.limit: + # note: self.limit could be -1 + if self.limit > 0 and count >= self.limit: return if self.module == "random" and self.limit: # "random" module does not return "query-continue"
pywikibot-commits@lists.wikimedia.org