Skip to content

Commit

Permalink
Catch error when can't find caches.json file in resource path
Browse files Browse the repository at this point in the history
  • Loading branch information
djw8605 committed Sep 6, 2019
1 parent 39e646c commit 20b7251
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion stashcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,10 @@ def get_best_stashcache():
os.path.join(prefix, "etc/stashcache/caches.json"),
os.path.join(prefix, "usr/share/stashcache/caches.json")]
if resource_string:
cache_files.insert(0, resource_string(__name__, 'caches.json'))
try:
cache_files.insert(0, resource_string(__name__, 'caches.json'))
except IOError as ioe:
logging.debug("Unable to retrieve caches.json using resource string, trying other locations")

for cache_file in cache_files:
if os.path.isfile(cache_file):
Expand Down

0 comments on commit 20b7251

Please sign in to comment.