Skip to content

Commit

Permalink
Merge pull request #104 from djw8605/fix-resource-path
Browse files Browse the repository at this point in the history
Catch error when can't find caches.json file in resource path
  • Loading branch information
matyasselmeci authored Sep 6, 2019
2 parents 39e646c + 20b7251 commit df49515
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 df49515

Please sign in to comment.