jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/705790 )
Change subject: [bugfix] remove typing hints with pywikibot.bot access
......................................................................
[bugfix] remove typing hints with pywikibot.bot access
typing hints with pywikibot.bot access fails for Python < 3.5.3
due to incomplete imports
Bug: T286844
Change-Id: Ie9cefe5f05238cfae7bbe8e6afbdc626c334f7d2
---
M pywikibot/bot_choice.py
1 file changed, 4 insertions(+), 7 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/bot_choice.py b/pywikibot/bot_choice.py
index a26fbad..7f35e7a 100755
--- a/pywikibot/bot_choice.py
+++ b/pywikibot/bot_choice.py
@@ -281,15 +281,13 @@
"""A simple choice consisting of an option, shortcut and
handler."""
- def __init__(self, option: str, shortcut: str,
- replacer: Optional['pywikibot.bot.InteractiveReplace']
- ) -> None:
+ def __init__(self, option: str, shortcut: str, replacer) -> None:
"""Initializer."""
super().__init__(option, shortcut)
self._replacer = replacer
@property
- def replacer(self) -> Optional['pywikibot.bot.InteractiveReplace']:
+ def replacer(self):
"""The replacer."""
return self._replacer
@@ -321,8 +319,7 @@
"""A choice returning a mix of the link new and current
link."""
- def __init__(self, option: str, shortcut: str,
- replacer: Optional['pywikibot.bot.InteractiveReplace'],
+ def __init__(self, option: str, shortcut: str, replacer,
replace_section: bool,
replace_label: bool) -> None:
"""Initializer."""
@@ -364,7 +361,7 @@
"""Add an option to always apply the default."""
- def __init__(self, replacer: Optional['pywikibot.bot.InteractiveReplace'],
+ def __init__(self, replacer,
option: str = 'always', shortcut: str = 'a') ->
None:
"""Initializer."""
super().__init__(option, shortcut, replacer)
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/705790
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: Ie9cefe5f05238cfae7bbe8e6afbdc626c334f7d2
Gerrit-Change-Number: 705790
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged