@@ -362,7 +362,7 @@ def _get_editor_value(editor):
362362 def contextMenuEvent (self , event ):
363363 menu = QtWidgets .QMenu (self )
364364 if self .objects :
365- tags = self ._selected_tags ()
365+ tags = list ( self ._selected_tags () )
366366 single_tag = len (tags ) == 1
367367 if single_tag :
368368 selected_tag = tags [0 ]
@@ -461,7 +461,7 @@ def _edit_tag(self, tag):
461461 EditTagDialog (self .parent , tag ).exec ()
462462
463463 def _edit_selected_tag (self ):
464- tags = self ._selected_tags (filter_func = self ._tag_is_editable )
464+ tags = list ( self ._selected_tags (filter_func = self ._tag_is_editable ) )
465465 if len (tags ) == 1 :
466466 self ._edit_tag (tags [0 ])
467467
@@ -500,11 +500,10 @@ def _tag_is_editable(self, tag):
500500 return self .tag_diff .status [tag ] & TagStatus .READONLY == 0
501501
502502 def _selected_tags (self , filter_func = None ):
503- tags = set (self .tag_diff .tag_names [item .row ()]
504- for item in self .selectedItems ())
505- if filter_func :
506- tags = filter (filter_func , tags )
507- return list (tags )
503+ for tag in set (self .tag_diff .tag_names [item .row ()]
504+ for item in self .selectedItems ()):
505+ if filter_func is None or filter_func (tag ):
506+ yield tag
508507
509508 def _update_selection (self ):
510509 files = set ()
0 commit comments