jenkins-bot submitted this change.

View Change

Approvals: Matěj Suchánek: Looks good to me, approved Xqt: Looks good to me, approved jenkins-bot: Verified
[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(-)

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 change 810938. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I0384adb0b7529696fa29ddc4216177f80b38b6bf
Gerrit-Change-Number: 810938
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki@aol.com>
Gerrit-Reviewer: Matěj Suchánek <matejsuchanek97@gmail.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged