()
| 537 | # --------------------------------------------------------------------------- |
| 538 | |
| 539 | def compact_traceback(): |
| 540 | exc = sys.exception() |
| 541 | tb = exc.__traceback__ |
| 542 | if not tb: # Must have a traceback |
| 543 | raise AssertionError("traceback does not exist") |
| 544 | tbinfo = [] |
| 545 | while tb: |
| 546 | tbinfo.append(( |
| 547 | tb.tb_frame.f_code.co_filename, |
| 548 | tb.tb_frame.f_code.co_name, |
| 549 | str(tb.tb_lineno) |
| 550 | )) |
| 551 | tb = tb.tb_next |
| 552 | |
| 553 | # just to be safe |
| 554 | del tb |
| 555 | |
| 556 | file, function, line = tbinfo[-1] |
| 557 | info = ' '.join(['[%s|%s|%s]' % x for x in tbinfo]) |
| 558 | return (file, function, line), type(exc), exc, info |
| 559 | |
| 560 | def close_all(map=None, ignore_all=False): |
| 561 | if map is None: |
no test coverage detected
searching dependent graphs…