This commit is contained in:
Kovid Goyal 2021-01-30 10:07:16 +05:30
commit 8a5a7b8807
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -298,11 +298,12 @@ def parse_marker_spec(ftype: str, parts: Sequence[str]) -> Tuple[str, Union[str,
@func_with_args('toggle_marker') @func_with_args('toggle_marker')
def toggle_marker(func: str, rest: str) -> FuncArgsType: def toggle_marker(func: str, rest: str) -> FuncArgsType:
import shlex
parts = rest.split(maxsplit=1) parts = rest.split(maxsplit=1)
if len(parts) != 2: if len(parts) != 2:
raise ValueError('{} is not a valid marker specification'.format(rest)) raise ValueError('{} is not a valid marker specification'.format(rest))
ftype, spec = parts ftype, spec = parts
parts = spec.split() parts = shlex.split(spec)
return func, list(parse_marker_spec(ftype, parts)) return func, list(parse_marker_spec(ftype, parts))