diff options
| author | Lorenz Leitner <lorenz.leitner@student.tugraz.at> | 2019-10-01 16:54:53 +0200 |
|---|---|---|
| committer | Lorenz Leitner <lorenz.leitner@student.tugraz.at> | 2019-10-01 16:54:53 +0200 |
| commit | 4cc2dda585a6e7f6fa8f801c2be42064204c71d8 (patch) | |
| tree | 9d05a8b2622a3a63737c544b3ef7741bdc0b25a7 /pywal/theme.py | |
| parent | b6a11f6338daabd33ffbfadc3a4f15e7080214eb (diff) | |
Fix FileNotFoundError if theme has never been set
Diffstat (limited to 'pywal/theme.py')
| -rw-r--r-- | pywal/theme.py | 7 |
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:") |
