use reraise from six

This commit is contained in:
Johnny Robeson 2016-06-20 05:41:17 -04:00
parent edb1cbc5fc
commit 36ed75cd01
3 changed files with 6 additions and 3 deletions

View file

@ -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

View file

@ -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()

View file

@ -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():