(event, args)
| 344 | sys.__excepthook__(exc_type, exc_value, exc_tb) |
| 345 | |
| 346 | def hook(event, args): |
| 347 | if event == "sys.excepthook": |
| 348 | if not isinstance(args[2], args[1]): |
| 349 | raise TypeError(f"Expected isinstance({args[2]!r}, " f"{args[1]!r})") |
| 350 | if args[0] != excepthook: |
| 351 | raise ValueError(f"Expected {args[0]} == {excepthook}") |
| 352 | print(event, repr(args[2])) |
| 353 | |
| 354 | sys.addaudithook(hook) |
| 355 | sys.excepthook = excepthook |
no test coverage detected
searching dependent graphs…