Skip to content

Uninstall rich.traceback? #1947

Answered by willmcgugan
LarsHill asked this question in Q&A
Feb 10, 2022 · 2 comments · 3 replies
Discussion options

You must be logged in to vote

IIRC install returns the original excepthook, so you can restore it afterwards.

However, you may be better off handling exceptions explicitly in your code. Assuming you have some top level entry point.

try:
    run()
except Exception:
    if rich_exceptions:
        console.print_exception()
    else:
        raise

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@LarsHill
Comment options

@LarsHill
Comment options

Answer selected by LarsHill
Comment options

You must be logged in to vote
1 reply
@antonymilne
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants