Mpaa has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/110686

Change subject: api.py: do not call self.update_limit() twice
......................................................................

api.py: do not call self.update_limit() twice

Change-Id: I0c4a0990ad79743eb57a39287bfa4973ca070a93
---
M pywikibot/data/api.py
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/86/110686/1

diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index d40cb3c..0d4ef21 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -582,12 +582,16 @@
 
         """
         limit = int(value)
+        if not hasattr(self, 'api_limit'):
+            self.update_limit()
+
         # don't update if limit is greater than maximum allowed by API
-        self.update_limit()
         if self.api_limit is None:
             self.query_limit = limit
         else:
             self.query_limit = min(self.api_limit, limit)
+        pywikibot.debug(u"%s: Set query_limit to %i."
+            % (self.__class__.__name__, self.query_limit), _logger)
 
     def set_maximum_items(self, value):
         """Set the maximum number of items to be retrieved from the wiki.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0c4a0990ad79743eb57a39287bfa4973ca070a93
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mpaa <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to