jenkins-bot submitted this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
[cleanup] Remove deprecated add_text -except argument

Xqt noted on our last review [1] that this argument was deprecated in 5.6 and
can now be removed.

[1] https://gerrit.wikimedia.org/r/c/pywikibot/core/+/695548/

Change-Id: If862c833dbef470212c63d3db0c4e800afbeeb2b
---
M scripts/add_text.py
M tests/add_text_tests.py
2 files changed, 0 insertions(+), 22 deletions(-)

diff --git a/scripts/add_text.py b/scripts/add_text.py
index b790d50..40480cb 100755
--- a/scripts/add_text.py
+++ b/scripts/add_text.py
@@ -65,7 +65,6 @@
from pywikibot.backports import Tuple
from pywikibot.bot_choice import QuitKeyboardInterrupt
from pywikibot.exceptions import (
- ArgumentDeprecationWarning,
EditConflictError,
IsRedirectPageError,
LockedPageError,
@@ -74,7 +73,6 @@
ServerError,
SpamblacklistError,
)
-from pywikibot.tools import issue_deprecation_warning
from pywikibot.tools.formatter import color_format

DEFAULT_ARGS = {
@@ -365,12 +363,6 @@
args['talk_page'] = True
elif option == '-noreorder':
args['reorder'] = False
- elif option == '-except':
- page_gen_arg = '-grepnot:{}'.format(value)
- issue_deprecation_warning(arg, page_gen_arg,
- 2, ArgumentDeprecationWarning,
- since='20201224')
- generator_factory.handle_arg(page_gen_arg)
elif option == '-excepturl':
args['regex_skip_url'] = value
else:
diff --git a/tests/add_text_tests.py b/tests/add_text_tests.py
index 30d987f..f4e9232 100644
--- a/tests/add_text_tests.py
+++ b/tests/add_text_tests.py
@@ -10,8 +10,6 @@
import pywikibot
import pywikibot.pagegenerators

-from pywikibot.exceptions import ArgumentDeprecationWarning
-from pywikibot.tools import suppress_warnings
from scripts.add_text import add_text, get_text, parse
from tests.aspects import TestCase

@@ -71,18 +69,6 @@
parse(['-text:hello', '-textfile:/some/path'],
self.generator_factory)

- @patch('pywikibot.handle_args', Mock(side_effect=lambda args: args))
- def test_except_argument(self):
- """Check the deprecated -except argument."""
- generator_factory = Mock()
- generator_factory.handle_args.side_effect = lambda args: args
-
- with suppress_warnings('-except:stuff is deprecated',
- ArgumentDeprecationWarning):
- parse(['-text:hello', '-except:stuff'], generator_factory)
-
- generator_factory.handle_arg.assert_called_with('-grepnot:stuff')
-
@patch('pywikibot.input')
@patch('pywikibot.handle_args', Mock(side_effect=lambda args: args))
def test_argument_prompt(self, input_mock):

To view, visit change 697191. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: If862c833dbef470212c63d3db0c4e800afbeeb2b
Gerrit-Change-Number: 697191
Gerrit-PatchSet: 1
Gerrit-Owner: Damian <atagar1@gmail.com>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki@aol.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged