mode.utils.tracebacks — mode-ng 0.4.0 documentation

# `mode.utils.tracebacks`

Traceback utilities.

class mode.utils.tracebacks.Traceback(frame: frame, lineno: Optional[int] = None, lasti: Optional[int] = None)

  Traceback object with truncated frames.

  classmethod from_agen(agen: AsyncGenerator, *, limit: int = 125) → _BaseTraceback
  classmethod from_coroutine(coro: Union[AsyncGenerator, Coroutine, Generator], *, depth: int = 0, limit: Optional[int] = 125) → _BaseTraceback
  classmethod from_task(task: Task, *, limit: int = 125) → _BaseTraceback

mode.utils.tracebacks.format_task_stack(task: Task, *, limit: int = 125, capture_locals: bool = False) → str

  Format `asyncio.Task` stack trace as a string.

mode.utils.tracebacks.print_task_stack(task: ~_asyncio.Task, *, file: ~typing.IO = <_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>, limit: int = 125, capture_locals: bool = False) → None

  Print the stack trace for an `asyncio.Task`.