Lines Matching refs:_ctx
876 def format(self, *, chain=True, _ctx=None):
889 if _ctx is None:
890 _ctx = _ExceptionPrintContext()
914 yield from _ctx.emit(msg)
917 yield from _ctx.emit('Traceback (most recent call last):\n')
918 yield from _ctx.emit(exc.stack.format())
919 yield from _ctx.emit(exc.format_exception_only())
920 elif _ctx.exception_group_depth > self.max_group_depth:
922 yield from _ctx.emit(
926 is_toplevel = (_ctx.exception_group_depth == 0)
928 _ctx.exception_group_depth += 1
931 yield from _ctx.emit(
934 yield from _ctx.emit(exc.stack.format())
936 yield from _ctx.emit(exc.format_exception_only())
942 _ctx.need_close = False
947 _ctx.need_close = True
954 yield (_ctx.indent() +
957 _ctx.exception_group_depth += 1
959 yield from exc.exceptions[i].format(chain=chain, _ctx=_ctx)
963 yield from _ctx.emit(
966 if last_exc and _ctx.need_close:
967 yield (_ctx.indent() +
969 _ctx.need_close = False
970 _ctx.exception_group_depth -= 1
973 assert _ctx.exception_group_depth == 1
974 _ctx.exception_group_depth = 0