jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/607753 )
Change subject: [cleanup] print a FutureWarning for deprecated tools ......................................................................
[cleanup] print a FutureWarning for deprecated tools
- print a FutureWarning for tools.Counter, tools.OrderedDict which should be replaced by the corresponding collections classes - print a FutureWarning for tools.count which should be replaced by itertools.count - print a FutureWarning for ContextManagerWrapper which should be replaced by other contextlib classes and functions
All of them where introduced for Python 2.6 and releases prior than 2.7.2 which where dropped more than 4 years ago. This stuff should be removed soon.
Change-Id: Ibb80f6a5a7c2ca01cb765ff8075b7d02ec18553a --- M pywikibot/tools/__init__.py 1 file changed, 6 insertions(+), 4 deletions(-)
Approvals: Dvorapa: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/tools/__init__.py b/pywikibot/tools/__init__.py index a6e7c88..edaf755 100644 --- a/pywikibot/tools/__init__.py +++ b/pywikibot/tools/__init__.py @@ -2198,9 +2198,11 @@
wrapper = ModuleDeprecationWrapper(__name__) -wrapper._add_deprecated_attr('Counter', collections.Counter, since='20160111') +wrapper._add_deprecated_attr('Counter', collections.Counter, since='20160111', + future_warning=True) wrapper._add_deprecated_attr('OrderedDict', collections.OrderedDict, - since='20160111') -wrapper._add_deprecated_attr('count', itertools.count, since='20160111') + since='20160111', future_warning=True) +wrapper._add_deprecated_attr('count', itertools.count, since='20160111', + future_warning=True) wrapper._add_deprecated_attr('ContextManagerWrapper', replacement_name='', - since='20180402') + since='20180402', future_warning=True)
pywikibot-commits@lists.wikimedia.org