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"

-- 
To view, visit https://gerrit.wikimedia.org/r/131991
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If25add4c3ba7892416195337d5a79993baf6d0d9
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <i...@gno.de>
Gerrit-Reviewer: Ladsgroup <ladsgr...@gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhall...@arctus.nl>
Gerrit-Reviewer: Russell Blau <russb...@imapmail.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to