jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/462162 )
Change subject: [cleanup] Remove maxint error message ......................................................................
[cleanup] Remove maxint error message
BaseBot._treat_counter does never exceed maxint limit because Python 2 yield plain integers unless the value is too large to be represented as a plain integer, in which case it yield a long integer. Therefore remove that error message.
Change-Id: Ic974854c9d31201c58668f9a454f500aa32cffb9 --- M pywikibot/bot.py 1 file changed, 1 insertion(+), 10 deletions(-)
Approvals: Framawiki: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/bot.py b/pywikibot/bot.py index 9721ded..68fdd5d 100644 --- a/pywikibot/bot.py +++ b/pywikibot/bot.py @@ -1466,13 +1466,11 @@ raise NotImplementedError('Variable %s.generator not set.' % self.__class__.__name__)
- maxint = 0 if PY2: - maxint = sys.maxint - # Python 2 does not clear previous exceptions and method `exit` # relies on sys.exc_info returning exceptions occurring in `run`. sys.exc_clear() + self.setup() try: for item in self.generator: @@ -1504,14 +1502,7 @@
# Process the page self.treat(page) - self._treat_counter += 1 - if maxint and self._treat_counter == maxint: - # Warn the user that the bot may not function correctly - pywikibot.error( - '\n%s: page count reached Python 2 sys.maxint (%d).\n' - 'Python 3 should be used to process very large batches' - % (self.__class__.__name__, sys.maxint)) else: self._generator_completed = True except GeneratorExit:
pywikibot-commits@lists.wikimedia.org