Skip to content

Commit

Permalink
Highlight the exception in a different color in tracebacks
Browse files Browse the repository at this point in the history
  • Loading branch information
asmeurer committed Oct 31, 2023
1 parent faaa7b5 commit 4c6349b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@
- Cmd-Shift-A in iTerm2 selects prompt
- Print exception group tracebacks from exceptiongroup better
- Make `from __future__ import annotations` work
- Highlight exception type in tracebacks
- Copilot (or LLM) tab completion

## 2.0 TODOs
Expand Down
4 changes: 3 additions & 1 deletion mypython/theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Translated from http://raebear.net/comp/emacscolors.html
"""
from pygments.token import Keyword, Name, Comment, String, Operator
from pygments.token import Keyword, Name, Comment, String, Operator, Generic
from pygments.style import Style
from pygments.lexers import Python3Lexer

Expand Down Expand Up @@ -67,6 +67,8 @@ class OneAMStyle(Style):
# Doesn't work
Name.Variable: "#a0522d", # sienna

# Used for the exception in tracebacks
Generic.Error: "#ff0000", # red
}

# Uncomment this to register the style with pygments
Expand Down

0 comments on commit 4c6349b

Please sign in to comment.