fixed minor errors

This commit is contained in:
Abhinav Sarkar 2009-01-02 13:29:06 +00:00
parent 25755a934c
commit 47c1697f3d
2 changed files with 6 additions and 2 deletions

View File

@ -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)

View File

@ -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])),