Remove backslashes from CLI theme names if no theme with the name is found

This commit is contained in:
Kovid Goyal 2021-09-12 09:35:31 +05:30
parent 9db9638bc3
commit efaeb0f0b2
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -549,7 +549,11 @@ def non_interactive(cli_opts: ThemesCLIOptions, theme_name: str) -> None:
try:
theme = themes[theme_name]
except KeyError:
raise SystemExit(f'No theme named: {theme_name}')
theme_name = theme_name.replace('\\', '')
try:
theme = themes[theme_name]
except KeyError:
raise SystemExit(f'No theme named: {theme_name}')
if cli_opts.dump_theme:
print(theme.raw)
return