jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/810938 )
Change subject: [bugfix] Improve _get_option_with_fallback logic in
harvest_template.py
......................................................................
[bugfix] Improve _get_option_with_fallback logic in harvest_template.py
Do not return False but True if local and default boolean options are True.
Because the local option cannot be overridden by a False value it is
surely intended to return True if the default is True even the local
option was still False.
Change-Id: I0384adb0b7529696fa29ddc4216177f80b38b6bf
---
M scripts/harvest_template.py
1 file changed, 1 insertion(+), 5 deletions(-)
Approvals:
Matěj Suchánek: Looks good to me, approved
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/harvest_template.py b/scripts/harvest_template.py
index 7bf679c..ab03f1b 100755
--- a/scripts/harvest_template.py
+++ b/scripts/harvest_template.py
@@ -258,11 +258,7 @@
.. seealso:: :class:`OptionHandler`
"""
- default = self.opt[option]
- local = handler.opt[option]
- if isinstance(default, bool) and isinstance(local, bool):
- return default is not local
- return local or default
+ return handler.opt[option] or self.opt[option]
def treat_page_and_item(self,
page: pywikibot.page.BasePage,
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/810938
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: I0384adb0b7529696fa29ddc4216177f80b38b6bf
Gerrit-Change-Number: 810938
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: D3r1ck01 <[email protected]>
Gerrit-Reviewer: Matěj Suchánek <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]