99 | | frames.append({ |
100 | | 'tb': tb, |
101 | | 'filename': filename, |
102 | | 'function': function, |
103 | | 'lineno': lineno + 1, |
104 | | 'vars': tb.tb_frame.f_locals.items(), |
105 | | 'id': id(tb), |
106 | | 'pre_context': pre_context, |
107 | | 'context_line': context_line, |
108 | | 'post_context': post_context, |
109 | | 'pre_context_lineno': pre_context_lineno + 1, |
110 | | }) |
| 99 | if pre_context_lineno: |
| 100 | frames.append({ |
| 101 | 'tb': tb, |
| 102 | 'filename': filename, |
| 103 | 'function': function, |
| 104 | 'lineno': lineno + 1, |
| 105 | 'vars': tb.tb_frame.f_locals.items(), |
| 106 | 'id': id(tb), |
| 107 | 'pre_context': pre_context, |
| 108 | 'context_line': context_line, |
| 109 | 'post_context': post_context, |
| 110 | 'pre_context_lineno': pre_context_lineno + 1, |
| 111 | }) |