Skip to content

Commit 927819d

Browse files
living180matthiask
authored andcommitted
Remove obsolete compatibility code
inspect.Traceback has existed since Python 2.6.
1 parent eba0e06 commit 927819d

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

debug_toolbar/utils.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,7 @@ def getframeinfo(frame, context=1):
222222
break
223223
lines = [line.decode(encoding, "replace") for line in lines]
224224

225-
if hasattr(inspect, "Traceback"):
226-
return inspect.Traceback(filename, lineno, frame.f_code.co_name, lines, index)
227-
else:
228-
return (filename, lineno, frame.f_code.co_name, lines, index)
225+
return inspect.Traceback(filename, lineno, frame.f_code.co_name, lines, index)
229226

230227

231228
def get_sorted_request_variable(variable):

0 commit comments

Comments
 (0)