(typ, exc, tb)
| 251 | seen = set() |
| 252 | |
| 253 | def print_exc(typ, exc, tb): |
| 254 | seen.add(id(exc)) |
| 255 | context = exc.__context__ |
| 256 | cause = exc.__cause__ |
| 257 | if cause is not None and id(cause) not in seen: |
| 258 | print_exc(type(cause), cause, cause.__traceback__) |
| 259 | print("\nThe above exception was the direct cause " |
| 260 | "of the following exception:\n", file=efile) |
| 261 | elif (context is not None and |
| 262 | not exc.__suppress_context__ and |
| 263 | id(context) not in seen): |
| 264 | print_exc(type(context), context, context.__traceback__) |
| 265 | print("\nDuring handling of the above exception, " |
| 266 | "another exception occurred:\n", file=efile) |
| 267 | if tb: |
| 268 | tbe = traceback.extract_tb(tb) |
| 269 | print('Traceback (most recent call last):', file=efile) |
| 270 | exclude = ("run.py", "rpc.py", "threading.py", "queue.py", |
| 271 | "debugger_r.py", "bdb.py") |
| 272 | cleanup_traceback(tbe, exclude) |
| 273 | traceback.print_list(tbe, file=efile) |
| 274 | lines = get_message_lines(typ, exc, tb) |
| 275 | for line in lines: |
| 276 | print(line, end='', file=efile) |
| 277 | |
| 278 | print_exc(typ, val, tb) |
| 279 |
no test coverage detected
searching dependent graphs…