mirror of
https://github.com/beetbox/beets.git
synced 2026-02-26 01:09:38 +01:00
test_replaygain: fix exception handling again
This is the same as d26b0bc1, which I reintroduced again in a new test
due to a botched rebase...
This commit is contained in:
parent
b37ef0e496
commit
ef59465869
1 changed files with 3 additions and 15 deletions
|
|
@ -329,25 +329,13 @@ class ImportTest(TestHelper):
|
|||
|
||||
self.setup_beets(disk=True)
|
||||
self.config['threaded'] = self.threaded
|
||||
self.config['replaygain'] = {
|
||||
'backend': self.backend,
|
||||
}
|
||||
self.config['replaygain']['backend'] = self.backend
|
||||
|
||||
try:
|
||||
self.load_plugins('replaygain')
|
||||
except Exception:
|
||||
import sys
|
||||
# store exception info so an error in teardown does not swallow it
|
||||
exc_info = sys.exc_info()
|
||||
try:
|
||||
self.teardown_beets()
|
||||
self.unload_plugins()
|
||||
except Exception:
|
||||
# if load_plugins() failed then setup is incomplete and
|
||||
# teardown operations may fail. In particular # {Item,Album}
|
||||
# may not have the _original_types attribute in unload_plugins
|
||||
pass
|
||||
raise None.with_traceback(exc_info[2])
|
||||
self.teardown_beets()
|
||||
self.unload_plugins()
|
||||
|
||||
self.importer = self.create_importer()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue