From fc9a480cd454610969b95322389f28279d3d3cbf Mon Sep 17 00:00:00 2001 From: Guido Falsi Date: Sat, 9 Jan 2021 11:41:31 +0100 Subject: [PATCH] Use python 3.7 compatible syntax. The := operator was introduced in python 3.8. I don't think making calibre incompatible with previous python versions is worth the use of the new operator here. FreeBSD at least uses python 3.7 by default and this would cause problems in providing calibre to users, and require them to custom compile software to get it. --- src/calibre/gui2/tag_browser/view.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/tag_browser/view.py b/src/calibre/gui2/tag_browser/view.py index 9dace785e9..aa1ab7a38c 100644 --- a/src/calibre/gui2/tag_browser/view.py +++ b/src/calibre/gui2/tag_browser/view.py @@ -782,8 +782,9 @@ class TagsView(QTreeView): # {{{ partial(self.context_menu_handler, action='search', search_state=TAG_SEARCH_STATES['mark_plus'], index=index)) - if add_child_search := (tag.is_hierarchical == '5state' and - len(tag_item.children)): + add_child_search = (tag.is_hierarchical == '5state' and + len(tag_item.children)) + if add_child_search: search_submenu.addAction(self.search_icon, _('Search for %s and its children')%display_name(tag), partial(self.context_menu_handler, action='search',