jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/562032 )
Change subject: [cleanup] Adjust deprecation warning ......................................................................
[cleanup] Adjust deprecation warning
It is 2020 already
Change-Id: I7064d31f3f59dbf7458121bd89316080a12d2f35 --- M pywikibot/__init__.py M tests/utils.py 2 files changed, 7 insertions(+), 8 deletions(-)
Approvals: Zhuyifei1999: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py index 41911bb..903d147 100644 --- a/pywikibot/__init__.py +++ b/pywikibot/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """The initialization file for the Pywikibot framework.""" # -# (C) Pywikibot team, 2008-2019 +# (C) Pywikibot team, 2008-2020 # # Distributed under the terms of the MIT license. # @@ -65,7 +65,7 @@ MediaWikiVersion as _MediaWikiVersion, redirect_func, ModuleDeprecationWrapper as _ModuleDeprecationWrapper, - PY2, PYTHON_VERSION, + PY2, UnicodeMixin, UnicodeType ) @@ -117,12 +117,11 @@
import sys warn(""" -Python {version} will be dropped {when}. +Python {version} will be dropped soon. It is recommended to use Python 3.5 or above. See T213287 for further information. -""".format(version=sys.version.split(None, 1)[0], - when='soon' if PYTHON_VERSION < (2, 7, 9) else 'in 2020'), - FutureWarning) +""".format(version=sys.version.split(None, 1)[0]), + FutureWarning) # probably adjust the line no in utils.execute()
for _name in textlib_methods: target = getattr(textlib, _name) diff --git a/tests/utils.py b/tests/utils.py index 702130f..3f73c08 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """Test utilities.""" # -# (C) Pywikibot team, 2013-2019 +# (C) Pywikibot team, 2013-2020 # # Distributed under the terms of the MIT license. # @@ -655,7 +655,7 @@ @type command: list of unicode """ if PY2: - command.insert(1, '-W ignore::FutureWarning:pywikibot:125') + command.insert(1, '-W ignore::FutureWarning:pywikibot:124') if cryptography_version and cryptography_version < [1, 3, 4]: command.insert(1, '-W ignore:Old version of cryptography:Warning') # Any environment variables added on Windows must be of type
pywikibot-commits@lists.wikimedia.org