From ef59465869b350b3a11c7b0e40d550d65fffb8a5 Mon Sep 17 00:00:00 2001 From: wisp3rwind <17089248+wisp3rwind@users.noreply.github.com> Date: Tue, 1 Feb 2022 21:39:42 +0100 Subject: [PATCH] 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... --- test/test_replaygain.py | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/test/test_replaygain.py b/test/test_replaygain.py index 499befee2..47e27b844 100644 --- a/test/test_replaygain.py +++ b/test/test_replaygain.py @@ -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()