Xqt has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/699906
)
Change subject: [fix] Fix _NotImplementedWarning import
......................................................................
[fix] Fix _NotImplementedWarning import
- import _NotImplementedWarning from tools._deprecate
- remove tools._NotImplementedWarning
- update docs
Change-Id: I65a067f721825029798aa7cfafae9a9ff2334e25
---
M pywikibot/exceptions.py
M pywikibot/tools/__init__.py
M pywikibot/tools/_deprecate.py
3 files changed, 5 insertions(+), 13 deletions(-)
Approvals:
Xqt: Looks good to me, approved
diff --git a/pywikibot/exceptions.py b/pywikibot/exceptions.py
index 0ff4b3a..136dc2a 100644
--- a/pywikibot/exceptions.py
+++ b/pywikibot/exceptions.py
@@ -144,7 +144,6 @@
RuntimeWarning: problems developers should have fixed, and users need to
be aware of its status.
- - tools._NotImplementedWarning: do not use
- NotImplementedWarning: functionality not implemented
UserWarning: warnings targeted at users
@@ -165,11 +164,8 @@
import sys
from typing import Optional, Union
-from pywikibot.tools import (
- ModuleDeprecationWrapper,
- _NotImplementedWarning,
- issue_deprecation_warning,
-)
+from pywikibot.tools import ModuleDeprecationWrapper, issue_deprecation_warning
+from pywikibot.tools._deprecate import _NotImplementedWarning
class NotImplementedWarning(_NotImplementedWarning):
diff --git a/pywikibot/tools/__init__.py b/pywikibot/tools/__init__.py
index 120eca9..efa2741 100644
--- a/pywikibot/tools/__init__.py
+++ b/pywikibot/tools/__init__.py
@@ -67,11 +67,6 @@
_logger = 'tools'
-class _NotImplementedWarning(RuntimeWarning):
-
- """Feature that is no longer implemented."""
-
-
def is_ip_address(value: str) -> bool:
"""Check if a value is a valid IPv4 or IPv6 address.
@@ -1338,8 +1333,7 @@
# deprecated parts ############################################################
-(a)deprecated('bot_choice.Option and its subclasses', since='20181217',
- future_warning=True)
+(a)deprecated('bot_choice.Option and its subclasses', since='20181217')
def concat_options(message, line_length, options):
"""DEPRECATED. Concatenate options."""
indent = len(message) + 2
diff --git a/pywikibot/tools/_deprecate.py b/pywikibot/tools/_deprecate.py
index 76c80e5..829b24c 100644
--- a/pywikibot/tools/_deprecate.py
+++ b/pywikibot/tools/_deprecate.py
@@ -14,6 +14,8 @@
args[0] to see if it callable. Therefore, a decorator must not accept
only one arg, and that arg be a callable, as it will be detected as
a deprecator without any arguments.
+
+*Changed in version 6.4:* deprecation decorators moved to _deprecate module
"""
#
# (C) Pywikibot team, 2008-2021
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/699906
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I65a067f721825029798aa7cfafae9a9ff2334e25
Gerrit-Change-Number: 699906
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged