mirror of
https://github.com/beetbox/beets.git
synced 2026-02-14 03:17:59 +01:00
use the real six.reraise in bluelet
This commit is contained in:
parent
36ed75cd01
commit
faea61a76e
1 changed files with 2 additions and 15 deletions
|
|
@ -9,6 +9,7 @@ Bluelet: easy concurrency without all the messy parallelism.
|
|||
"""
|
||||
from __future__ import division, absolute_import, print_function
|
||||
|
||||
import six
|
||||
import socket
|
||||
import select
|
||||
import sys
|
||||
|
|
@ -19,20 +20,6 @@ import time
|
|||
import collections
|
||||
|
||||
|
||||
# A little bit of "six" (Python 2/3 compatibility): cope with PEP 3109 syntax
|
||||
# changes.
|
||||
|
||||
PY3 = sys.version_info[0] == 3
|
||||
if PY3:
|
||||
def _reraise(typ, exc, tb):
|
||||
raise exc.with_traceback(tb)
|
||||
else:
|
||||
exec("""
|
||||
def _reraise(typ, exc, tb):
|
||||
raise typ, exc, tb
|
||||
""")
|
||||
|
||||
|
||||
# Basic events used for thread scheduling.
|
||||
|
||||
class Event(object):
|
||||
|
|
@ -214,7 +201,7 @@ class ThreadException(Exception):
|
|||
self.exc_info = exc_info
|
||||
|
||||
def reraise(self):
|
||||
_reraise(self.exc_info[0], self.exc_info[1], self.exc_info[2])
|
||||
six.reraise(self.exc_info[0], self.exc_info[1], self.exc_info[2])
|
||||
|
||||
|
||||
SUSPENDED = Event() # Special sentinel placeholder for suspended threads.
|
||||
|
|
|
|||
Loading…
Reference in a new issue