summaryrefslogtreecommitdiff
path: root/nephilim/plugins/Lyrics.py
diff options
context:
space:
mode:
Diffstat (limited to 'nephilim/plugins/Lyrics.py')
-rw-r--r--nephilim/plugins/Lyrics.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/nephilim/plugins/Lyrics.py b/nephilim/plugins/Lyrics.py
index b569094..a07916d 100644
--- a/nephilim/plugins/Lyrics.py
+++ b/nephilim/plugins/Lyrics.py
@@ -262,7 +262,7 @@ class Lyrics(Plugin):
if lyrics:
self.save_lyrics(lyrics)
return self.o.set_lyrics(song, lyrics)
- except IOError, e:
+ except IOError as e:
self.logger.info('Error reading lyrics file: %s.'%e)
for fetcher in self.__fetchers:
@@ -286,7 +286,7 @@ class Lyrics(Plugin):
try:
os.remove(path)
- except (IOError, OSError), e:
+ except (IOError, OSError) as e:
self.logger.error('Error removing lyrics file %s: %s'%(path, e))
def get_settings_widget(self):
@@ -385,8 +385,8 @@ class FetchAnimelyrics(metadata_fetcher.MetadataFetcher):
def __handle_search_res(self):
# TODO use Qt xml functions
try:
- tree = etree.HTML(unicode(self.rep.readAll(), encoding = 'utf-8', errors='ignore'))
- except etree.XMLSyntaxError, e:
+ tree = etree.HTML(str(self.rep.readAll(), encoding = 'utf-8', errors='ignore'))
+ except etree.XMLSyntaxError as e:
self.logger.error('Error parsing lyrics: %s' %e)
return self.finish()
@@ -407,8 +407,8 @@ class FetchAnimelyrics(metadata_fetcher.MetadataFetcher):
def __handle_lyrics(self):
lyrics = ''
try:
- tree = etree.HTML(unicode(self.rep.readAll(), encoding = 'utf-8'))
- except etree.XMLSyntaxError, e:
+ tree = etree.HTML(str(self.rep.readAll(), encoding = 'utf-8'))
+ except etree.XMLSyntaxError as e:
self.logger.error('Error parsing lyrics: %s' %e)
return self.finish()
for elem in tree.iterfind('.//pre'):