jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/704629 )
Change subject: [bugfix] OutputProxyOption's 'out' could return None
......................................................................
[bugfix] OutputProxyOption's 'out' could return None
OutputOption has a string 'out' property and an 'output()' method that
prints
(returning None).
When OutputProxyOption lacked its 'out' property it returned output() instead.
The 'out' type hint says this returns a string, not None. As such mypy
rightfully warns about this with...
pywikibot/bot_choice.py:188: error: "output" of "OutputOption" does
not
return a value
Simply returning an empty string instead.
Bug: T286403
Change-Id: Iab31d5f6cff4d4b67c75611c36ba614f9cd8e658
---
M pywikibot/bot_choice.py
1 file changed, 3 insertions(+), 2 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/bot_choice.py b/pywikibot/bot_choice.py
index 89daa17..5dd3df8 100755
--- a/pywikibot/bot_choice.py
+++ b/pywikibot/bot_choice.py
@@ -182,12 +182,13 @@
@property
def out(self) -> str:
- """Return te contents."""
+ """Return the contents."""
if not hasattr(self._outputter, 'out'):
issue_deprecation_warning('{} without "out" property'
.format(self.__class__.__name__),
since='6.2.0')
- return self._outputter.output()
+ self._outputter.output()
+ return ''
return self._outputter.out
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/704629
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: Iab31d5f6cff4d4b67c75611c36ba614f9cd8e658
Gerrit-Change-Number: 704629
Gerrit-PatchSet: 4
Gerrit-Owner: Damian <atagar1(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged