lastfm return None on error

lastfm album art fetching should return None if there is a problem
opening the image url.
This commit is contained in:
Bryan Schumaker 2010-11-17 23:29:51 -05:00
parent 41a73bdda0
commit 3eff3c6aee
1 changed files with 4 additions and 1 deletions

View File

@ -30,7 +30,10 @@ class LastFmRequest(dict):
url["api_key"] = APIKEY
for param in self:
url[param] = self[param]
file = url.open()
try:
file = url.open()
except:
return None
if file == None:
return None
if printfile==True: