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

@ -546,6 +546,10 @@ def non_interactive(cli_opts: ThemesCLIOptions, theme_name: str) -> None:
themes = load_themes(cli_opts.cache_age)
except NoCacheFound as e:
raise SystemExit(str(e))
try:
theme = themes[theme_name]
except KeyError:
theme_name = theme_name.replace('\\', '')
try:
theme = themes[theme_name]
except KeyError: