From 581fba62883e15f08ed0be5ef02b555107b85d8e Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Thu, 2 Jun 2016 11:58:14 -0700 Subject: [PATCH] lyrics: Avoid crash when enabling google If you *both* haven't set an API key *and* BeautifulSoup wasn't installed, the list.remove() call would crash. (This came up when running the tests on a fresh machine without many dependencies.) --- beetsplug/lyrics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beetsplug/lyrics.py b/beetsplug/lyrics.py index b6936e1be..105dfa341 100644 --- a/beetsplug/lyrics.py +++ b/beetsplug/lyrics.py @@ -611,7 +611,7 @@ class LyricsPlugin(plugins.BeetsPlugin): u'provide an API key in the configuration. ' u'See the documentation for further details.') sources.remove('google') - if not HAS_BEAUTIFUL_SOUP: + elif not HAS_BEAUTIFUL_SOUP: self._log.warn(u'To use the google lyrics source, you must ' u'install the beautifulsoup4 module. See the ' u'documentation for further details.')