Let's do this a slightly better way that I saw in one of the src/ files

This commit is contained in:
James Vega 2004-08-28 22:46:12 +00:00
parent 6b59933673
commit 23332315c9

View File

@ -120,8 +120,8 @@ class Amazon(callbacks.PrivmsgCommandAndRegexp):
else:
results['url'] = ' <%s>' % results['url']
s = reply % results
s = u'%s' % s
s = s.encode('utf-8')
if isinstance(s, unicode):
s = s.encode('utf-8')
res.append(str(s))
except amazon.AmazonError, e:
self.log.warning(str(e))