This commit is contained in:
Will McGugan 2021-09-24 09:41:23 +01:00
parent 1b49c9fd92
commit e96d889beb
7 changed files with 174 additions and 42 deletions

View file

@ -0,0 +1,25 @@
"""
Demonstrates Rich tracebacks for recursion errors.
Rich can exclude frames in the middle to avoid huge tracebacks.
"""
from rich.console import Console
def foo(n):
return bar(n)
def bar(n):
return foo(n)
console = Console()
try:
foo(1)
except Exception:
console.print_exception(max_frames=20)