jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/566521 )
Change subject: [IMPR] Increase skip counter and other improvements ......................................................................
[IMPR] Increase skip counter and other improvements
- increase _skip_counter if page is skipped by SkipPageError exception - shorten info dict assignments - shorten initialized_page assignment
Change-Id: I967fe7033a2ad0ee571795adc4984a70d1bc87fc --- M pywikibot/bot.py 1 file changed, 5 insertions(+), 11 deletions(-)
Approvals: Mpaa: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/bot.py b/pywikibot/bot.py index d0935a8..afafcc5 100644 --- a/pywikibot/bot.py +++ b/pywikibot/bot.py @@ -420,13 +420,9 @@ log('PACKAGES:') for name in sorted(packages.keys()): info = packages[name] - if 'path' not in info: - if 'type' in info: - info['path'] = '[' + info['type'] + ']' - else: - info['path'] = '[path unknown]' - if 'ver' not in info: - info['ver'] = '??' + info.setdefault('path', + '[{}]'.format(info.get('type', 'path unknown'))) + info.setdefault('ver', '??') if 'err' in info: log(' %(name)s: %(err)s' % info) else: @@ -1514,12 +1510,10 @@ # Python 2 does not clear the exception and it may seem # that the generator stopped due to an exception sys.exc_clear() + self._skip_counter += 1 continue else: - if initialized_page is None: - page = item - else: - page = initialized_page + page = initialized_page or item
assert isinstance(page, pywikibot.page.BasePage), ( '"page" is not a pywikibot.page.BasePage object but {}.'
pywikibot-commits@lists.wikimedia.org