From 47c1697f3da168cdb30dc5e5419f17f2e4133aef Mon Sep 17 00:00:00 2001 From: Abhinav Sarkar Date: Fri, 2 Jan 2009 13:29:06 +0000 Subject: [PATCH] fixed minor errors --- lastfm/api.py | 5 ++++- lastfm/artist.py | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lastfm/api.py b/lastfm/api.py index bfd2474..b6abaf3 100644 --- a/lastfm/api.py +++ b/lastfm/api.py @@ -177,7 +177,10 @@ class Api(object): return None def get_venue(self, venue): - return self.search_venue(venue)[0] + try: + return self.search_venue(venue)[0] + except IndexError: + return None def search_venue(self, venue): return Venue.search(self, search_item = venue) diff --git a/lastfm/artist.py b/lastfm/artist.py index 7763f4c..b83024f 100644 --- a/lastfm/artist.py +++ b/lastfm/artist.py @@ -311,7 +311,8 @@ class Artist(LastfmBase, Cacheable, Sharable, Shoutable, Searchable, Taggable): ] self._bio = Wiki( self, - published = datetime(*(time.strptime( + published = data.findtext('bio/published').strip() and + datetime(*(time.strptime( data.findtext('bio/published').strip(), '%a, %d %b %Y %H:%M:%S +0000' )[0:6])),