jenkins-bot merged this change.
pagegenerators.py: fix tests in PY2 for -querypage
Bug: T214234
Change-Id: I0f09ff13c760e506081521e9dfacb20a5adeb9f3
---
M pywikibot/pagegenerators.py
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py
index d735c1f..f342683 100644
--- a/pywikibot/pagegenerators.py
+++ b/pywikibot/pagegenerators.py
@@ -59,6 +59,9 @@
if sys.version_info[0] > 2:
basestring = (str, )
+ from itertools import zip_longest
+else:
+ from itertools import izip_longest as zip_longest
_logger = 'pagegenerators'
@@ -754,8 +757,7 @@
max_w = max(len(p) for p in pages[::2]) + 4
txt = 'Available special pages:\n'
- for a, b in itertools.zip_longest(pages[::2], pages[1::2],
- fillvalue=''):
+ for a, b in zip_longest(pages[::2], pages[1::2], fillvalue=''):
txt += ' {a:<{max_w}}{b}\n'.format(a=a, b=b, max_w=max_w)
txt += ('\nMaximum number of pages to return is {max} '
'({highmax} for bots).\n'.format(**limit))
To view, visit change 487630. To unsubscribe, or for help writing mail filters, visit settings.