LEFT | RIGHT |
1 """Extract, format and print information about Python stack traces.""" | 1 """Extract, format and print information about Python stack traces.""" |
2 | 2 |
3 import linecache | 3 import linecache |
4 import sys | 4 import sys |
5 import types | 5 import types |
6 import itertools | 6 import itertools |
7 | 7 |
8 __all__ = ['extract_stack', 'extract_tb', 'format_exception', | 8 __all__ = ['extract_stack', 'extract_tb', 'format_exception', |
9 'format_exception_only', 'format_list', 'format_stack', | 9 'format_exception_only', 'format_list', 'format_stack', |
10 'format_tb', 'print_exc', 'format_exc', 'print_exception', | 10 'format_tb', 'print_exc', 'format_exc', 'print_exception', |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 name = co.co_name | 328 name = co.co_name |
329 linecache.checkcache(filename) | 329 linecache.checkcache(filename) |
330 line = linecache.getline(filename, lineno, f.f_globals) | 330 line = linecache.getline(filename, lineno, f.f_globals) |
331 if line: line = line.strip() | 331 if line: line = line.strip() |
332 else: line = None | 332 else: line = None |
333 list.append((filename, lineno, name, line)) | 333 list.append((filename, lineno, name, line)) |
334 f = f.f_back | 334 f = f.f_back |
335 n = n+1 | 335 n = n+1 |
336 list.reverse() | 336 list.reverse() |
337 return list | 337 return list |
LEFT | RIGHT |