aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordylan <[email protected]>2019-10-01 18:13:08 +0300
committerGitHub <[email protected]>2019-10-01 18:13:08 +0300
commitc18f4014f969504deaeb692aa88660ee4cb10f3f (patch)
tree9d05a8b2622a3a63737c544b3ef7741bdc0b25a7
parentMerge pull request #456 from LoLei/305-symbol-theme (diff)
parentFix FileNotFoundError if theme has never been set (diff)
downloadpywal-c18f4014f969504deaeb692aa88660ee4cb10f3f.tar.xz
pywal-c18f4014f969504deaeb692aa88660ee4cb10f3f.zip
Merge pull request #457 from LoLei/456-fix-FileNotFoundError
[Bug] Fix error if theme has never been set
-rw-r--r--pywal/theme.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/pywal/theme.py b/pywal/theme.py
index 2b14600..706ed31 100644
--- a/pywal/theme.py
+++ b/pywal/theme.py
@@ -19,8 +19,11 @@ def list_out():
user_themes = [theme.name.replace(".json", "")
for theme in list_themes_user()]
- last_used_theme = util.read_file(os.path.join(
- CACHE_DIR, "last_used_theme"))[0].replace(".json", "")
+ try:
+ last_used_theme = util.read_file(os.path.join(
+ CACHE_DIR, "last_used_theme"))[0].replace(".json", "")
+ except FileNotFoundError:
+ last_used_theme = ""
if user_themes:
print("\033[1;32mUser Themes\033[0m:")