From 36ed75cd01e396edd764c9884de0b27d09cfd92e Mon Sep 17 00:00:00 2001 From: Johnny Robeson Date: Mon, 20 Jun 2016 05:41:17 -0400 Subject: [PATCH] use reraise from six --- beets/util/pipeline.py | 3 ++- test/test_logging.py | 3 ++- test/test_replaygain.py | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/beets/util/pipeline.py b/beets/util/pipeline.py index 648d11b70..1a0cd4b5c 100644 --- a/beets/util/pipeline.py +++ b/beets/util/pipeline.py @@ -37,6 +37,7 @@ from __future__ import division, absolute_import, print_function from six.moves import queue from threading import Thread, Lock import sys +import six BUBBLE = '__PIPELINE_BUBBLE__' POISON = '__PIPELINE_POISON__' @@ -431,7 +432,7 @@ class Pipeline(object): exc_info = thread.exc_info if exc_info: # Make the exception appear as it was raised originally. - raise exc_info[0], exc_info[1], exc_info[2] + six.reraise(exc_info[0], exc_info[1], exc_info[2]) def pull(self): """Yield elements from the end of the pipeline. Runs the stages diff --git a/test/test_logging.py b/test/test_logging.py index 2de8a3ceb..6e5e6c8b6 100644 --- a/test/test_logging.py +++ b/test/test_logging.py @@ -14,6 +14,7 @@ import beetsplug from test import _common from test._common import unittest, TestCase from test import helper +import six class LoggingTest(TestCase): @@ -218,7 +219,7 @@ class ConcurrentEventsTest(TestCase, helper.TestHelper): def check_dp_exc(): if dp.exc_info: - raise dp.exc_info[1], None, dp.exc_info[2] + six.reraise(dp.exc_info[1], None, dp.exc_info[2]) try: dp.lock1.acquire() diff --git a/test/test_replaygain.py b/test/test_replaygain.py index e3fdf18a6..d2a8aa9ba 100644 --- a/test/test_replaygain.py +++ b/test/test_replaygain.py @@ -23,6 +23,7 @@ from beets import config from beets.mediafile import MediaFile from beetsplug.replaygain import (FatalGstreamerPluginReplayGainError, GStreamerBackend) +import six try: import gi @@ -62,7 +63,7 @@ class ReplayGainCliTestBase(TestHelper): # teardown operations may fail. In particular # {Item,Album} # may not have the _original_types attribute in unload_plugins pass - raise exc_info[1], None, exc_info[2] + six.reraise(exc_info[1], None, exc_info[2]) album = self.add_album_fixture(2) for item in album.items():