jenkins-bot merged this change.
Use FutureWarning for warnings intended for end users
- this could replace some important deprecation warnings
which aren't shown by default
- show FutureWarnings only once
- as first FutureWarning use dropping warning fpr Python 2.7.2/3
Bug: T191192
Change-Id: I79a375e9bc8754a79cd68b04c48353f74cd3f90d
---
M pywikibot/__init__.py
M pywikibot/bot.py
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index 76fa14c..c9230c0 100644
--- a/pywikibot/__init__.py
+++ b/pywikibot/__init__.py
@@ -137,7 +137,7 @@
warn(
'Pywikibot will soon drop support for Python 2.7.2 and 2.7.3, '
'please update your Python.',
- DeprecationWarning,
+ FutureWarning,
)
diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index 9721ded..4c4d95b 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -312,6 +312,7 @@
warnings.filterwarnings("always")
elif config.verbose_output:
warnings.filterwarnings("module")
+ warnings.filterwarnings('once', category=FutureWarning)
root_logger.handlers = [] # remove any old handlers
To view, visit change 462138. To unsubscribe, or for help writing mail filters, visit settings.