Skip to content

Commit 9f6f864

Browse files
a-detisteionelmc
authored andcommitted
vendore reraise() from six
1 parent 66e14cd commit 9f6f864

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

Diff for: ci/requirements.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
virtualenv>=16.6.0
22
pip>=19.1.1
33
setuptools>=18.0.1
4-
six>=1.14.0
54
tox
65
twine

Diff for: setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def read(*names, **kwargs):
6464
],
6565
python_requires='>=3.8',
6666
install_requires=[
67-
# eg: "aspectlib==1.1.1", "six>=1.7",
67+
# eg: "aspectlib==1.1.1",
6868
],
6969
extras_require={
7070
# eg:

Diff for: src/tblib/decorators.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
import sys
22
from functools import wraps
33

4-
from six import reraise
5-
64
from . import Traceback
75

86

7+
def reraise(tp, value, tb=None):
8+
try:
9+
if value is None:
10+
value = tp()
11+
if value.__traceback__ is not tb:
12+
raise value.with_traceback(tb)
13+
raise value
14+
finally:
15+
value = None
16+
tb = None
17+
18+
919
class Error:
1020
def __init__(self, exc_type, exc_value, traceback):
1121
self.exc_type = exc_type

0 commit comments

Comments
 (0)