elif string == '/':
first_choice = current_selector
second_choice = _parse_format_selection(tokens, inside_choice=True)
- current_selector = None
- selectors.append(FormatSelector(PICKFIRST, (first_choice, second_choice), []))
+ current_selector = FormatSelector(PICKFIRST, (first_choice, second_choice), [])
elif string == '[':
if not current_selector:
current_selector = FormatSelector(SINGLE, 'best', [])
format_spec = selector.selector
def selector_function(formats):
+ formats = list(formats)
+ if not formats:
+ return
if format_spec == 'all':
for f in formats:
yield f