jenkins-bot merged this change.
[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(-)
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)
To view, visit change 607753. To unsubscribe, or for help writing mail filters, visit settings.