@@ -32,8 +32,8 @@ def _format_stack_trace(frames):
3232 return result
3333
3434
35- def _extract_stack (f , skip , limit ):
36- if f is None :
35+ def _extract_stack (frame , skip , limit ):
36+ if frame is None :
3737 return []
3838
3939 # For calculating the stack trace we have the bottom most frame we
@@ -42,21 +42,21 @@ def _extract_stack(f, skip, limit):
4242 # order we want as it is more efficient.
4343
4444 n = 0
45- l = []
45+ frame_list = []
4646
47- while f is not None and skip > 0 :
48- f = f .f_back
47+ while frame is not None and skip > 0 :
48+ frame = frame .f_back
4949 skip -= 1
5050
51- while f is not None and n < limit :
52- l .append (dict ( source = f .f_code .co_filename , line = f .f_lineno , name = f .f_code .co_name ) )
51+ while frame is not None and n < limit :
52+ frame_list .append ({ " source" : frame .f_code .co_filename , " line" : frame .f_lineno , " name" : frame .f_code .co_name } )
5353
54- f = f .f_back
54+ frame = frame .f_back
5555 n += 1
5656
57- l .reverse ()
57+ frame_list .reverse ()
5858
59- return l
59+ return frame_list
6060
6161
6262def current_stack (skip = 0 , limit = None ):
@@ -66,9 +66,9 @@ def current_stack(skip=0, limit=None):
6666 try :
6767 raise ZeroDivisionError
6868 except ZeroDivisionError :
69- f = sys .exc_info ()[2 ].tb_frame .f_back
69+ frame = sys .exc_info ()[2 ].tb_frame .f_back
7070
71- return _format_stack_trace (_extract_stack (f , skip , limit ))
71+ return _format_stack_trace (_extract_stack (frame , skip , limit ))
7272
7373
7474def _extract_tb (tb , limit ):
@@ -93,21 +93,21 @@ def _extract_tb(tb, limit):
9393 n += 1
9494
9595 n = 0
96- l = []
96+ frame_list = []
9797
9898 # We have now the top traceback object for the limit of what we are
9999 # to return. The bottom most will be that where the error occurred.
100100
101101 tb = top
102102
103103 while tb is not None and n < limit :
104- f = tb .tb_frame
105- l .append (dict ( source = f .f_code .co_filename , line = tb .tb_lineno , name = f .f_code .co_name ) )
104+ frame = tb .tb_frame
105+ frame_list .append ({ " source" : frame .f_code .co_filename , " line" : tb .tb_lineno , " name" : frame .f_code .co_name } )
106106
107107 tb = tb .tb_next
108108 n += 1
109109
110- return l
110+ return frame_list
111111
112112
113113def exception_stack (tb , limit = None ):
0 commit comments