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.
This commit is contained in:
Guido Falsi 2021-01-09 11:41:31 +01:00
parent 986408809c
commit fc9a480cd4

View File

@ -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',