(
self,
etype: type,
evalue: Optional[BaseException],
etb: Optional[TracebackType] = None,
tb_offset: Optional[int] = None,
context: int = 5,
)
| 1252 | print("\nKeyboardInterrupt") |
| 1253 | |
| 1254 | def structured_traceback( |
| 1255 | self, |
| 1256 | etype: type, |
| 1257 | evalue: Optional[BaseException], |
| 1258 | etb: Optional[TracebackType] = None, |
| 1259 | tb_offset: Optional[int] = None, |
| 1260 | context: int = 5, |
| 1261 | ) -> list[str]: |
| 1262 | # tb: TracebackType or tupleof tb types ? |
| 1263 | if etype is None: |
| 1264 | etype, evalue, etb = sys.exc_info() |
| 1265 | if isinstance(etb, tuple): |
| 1266 | # tb is a tuple if this is a chained exception. |
| 1267 | self.tb = etb[0] |
| 1268 | else: |
| 1269 | self.tb = etb |
| 1270 | return FormattedTB.structured_traceback( |
| 1271 | self, etype, evalue, etb, tb_offset, context |
| 1272 | ) |
| 1273 | |
| 1274 | |
| 1275 | # --------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected