jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/561998 )
Change subject: [PY3] Make Python 2 more Python 3 compatible ......................................................................
[PY3] Make Python 2 more Python 3 compatible
Use zip from future_builtins to get Python 3 behaviour.
Bug: T228833 Change-Id: Ie94f408d4db8410b30aabfab7968a0e039b8e66a --- M pywikibot/bot.py M pywikibot/userinterfaces/terminal_interface_base.py M tests/api_tests.py 3 files changed, 9 insertions(+), 3 deletions(-)
Approvals: D3r1ck01: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/bot.py b/pywikibot/bot.py index 6029cc1..e496889 100644 --- a/pywikibot/bot.py +++ b/pywikibot/bot.py @@ -54,7 +54,7 @@ used. """ # -# (C) Pywikibot team, 2008-2019 +# (C) Pywikibot team, 2008-2020 # # Distributed under the terms of the MIT license. # @@ -134,6 +134,8 @@ ) from pywikibot.tools.formatter import color_format
+if PY2: + from future_builtins import zip
# Note: all output goes through python std library "logging" module _logger = 'bot' diff --git a/pywikibot/userinterfaces/terminal_interface_base.py b/pywikibot/userinterfaces/terminal_interface_base.py index 514a87b..e1bc4bf 100755 --- a/pywikibot/userinterfaces/terminal_interface_base.py +++ b/pywikibot/userinterfaces/terminal_interface_base.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """Base for terminal user interfaces.""" # -# (C) Pywikibot team, 2003-2018 +# (C) Pywikibot team, 2003-2020 # # Distributed under the terms of the MIT license. # @@ -24,6 +24,9 @@ from pywikibot.tools import deprecated, PY2 from pywikibot.userinterfaces import transliteration
+if PY2: + from future_builtins import zip + transliterator = transliteration.transliterator(config.console_encoding)
colors = [ diff --git a/tests/api_tests.py b/tests/api_tests.py index 18d7603..c25e790 100644 --- a/tests/api_tests.py +++ b/tests/api_tests.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """API test module.""" # -# (C) Pywikibot team, 2007-2019 +# (C) Pywikibot team, 2007-2020 # # Distributed under the terms of the MIT license. # @@ -36,6 +36,7 @@ if not PY2: from urllib.parse import unquote_to_bytes else: + from future_builtins import zip from urllib import unquote_plus as unquote_to_bytes
pywikibot-commits@lists.wikimedia.org