jenkins-bot has submitted this change and it was merged.

Change subject: APIGenerator.set_maximum_items: Don't compare int with None
......................................................................


APIGenerator.set_maximum_items: Don't compare int with None

`query_increment` can be None. In Python 2 None is less than any number but
Python 3 raises "TypeError: unorderable types: int() < NoneType()".

test_continue (tests.site_tests.TestDataSiteSearchEntities) was failing
because of this issue.

Change-Id: I73e711014303a397a1009c76798d2cfefabc608b
---
M pywikibot/data/api.py
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index c087bb5..3b2ae9d 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -2435,7 +2435,7 @@
         @type value: int
         """
         self.limit = int(value)
-        if self.limit < self.query_increment:
+        if self.query_increment and self.limit < self.query_increment:
             self.request[self.limit_name] = self.limit
             pywikibot.debug(u"%s: Set request item limit to %i"
                             % (self.__class__.__name__, self.limit), _logger)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I73e711014303a397a1009c76798d2cfefabc608b
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Dalba <dalba.w...@gmail.com>
Gerrit-Reviewer: John Vandenberg <jay...@gmail.com>
Gerrit-Reviewer: Xqt <i...@gno.de>
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