| Conditions | 2 |
| Total Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | """Shared utility functions.""" |
||
| 7 | 6 | def format_exc_skip(skip, limit=None): |
|
| 8 | """Like traceback.format_exc but allow skipping the first frames.""" |
||
| 9 | 6 | type, val, tb = sys.exc_info() |
|
|
|
|||
| 10 | 6 | for i in range(skip): |
|
| 11 | 6 | tb = tb.tb_next |
|
| 12 | return ('\n'.join(format_exception(type, val, tb, limit))).rstrip() |
||
| 13 |
It is generally discouraged to redefine built-ins as this makes code very hard to read.