libsaria: Catch errors when writing cache files

The user doesn't want to see these...
This commit is contained in:
Bryan Schumaker 2011-06-18 13:27:21 -04:00
parent 34c7bc374e
commit 868359a4a4
1 changed files with 6 additions and 3 deletions

View File

@ -27,9 +27,12 @@ def make_cache_path(artist, album, file):
def fill_cache(artist, album, title, cache_func, cache_path):
text = cache_func(artist, album, title)
if text != None:
f = open(cache_path, 'w')
f.write(text)
f.close()
try:
f = open(cache_path, 'w')
f.write(text)
f.close()
except:
pass
return True
return False