Skip to content

Commit 10413a2

Browse files
wenghionelmc
authored andcommitted
Remove support for Python 3.7
1 parent 92df3b2 commit 10413a2

File tree

1 file changed

+8
-29
lines changed

1 file changed

+8
-29
lines changed

src/tblib/__init__.py

+8-29
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import re
22
import sys
3-
from types import CodeType
43

54
__version__ = '3.0.0'
65
__all__ = 'Traceback', 'TracebackParseError', 'Frame', 'Code'
@@ -124,34 +123,14 @@ def as_traceback(self):
124123
)
125124
while current:
126125
f_code = current.tb_frame.f_code
127-
if hasattr(stub, 'replace'):
128-
# Python 3.8 and newer
129-
code = stub.replace(
130-
co_firstlineno=current.tb_lineno,
131-
co_argcount=0,
132-
co_filename=f_code.co_filename,
133-
co_name=f_code.co_name,
134-
co_freevars=(),
135-
co_cellvars=(),
136-
)
137-
else:
138-
code = CodeType(
139-
0,
140-
stub.co_kwonlyargcount,
141-
stub.co_nlocals,
142-
stub.co_stacksize,
143-
stub.co_flags,
144-
stub.co_code,
145-
stub.co_consts,
146-
stub.co_names,
147-
stub.co_varnames,
148-
f_code.co_filename,
149-
f_code.co_name,
150-
current.tb_lineno,
151-
stub.co_lnotab,
152-
(),
153-
(),
154-
)
126+
code = stub.replace(
127+
co_firstlineno=current.tb_lineno,
128+
co_argcount=0,
129+
co_filename=f_code.co_filename,
130+
co_name=f_code.co_name,
131+
co_freevars=(),
132+
co_cellvars=(),
133+
)
155134

156135
# noinspection PyBroadException
157136
try:

0 commit comments

Comments
 (0)