answered 5 years ago
You should probably look at IPython.core.ultratb . It looks like that's the part of IPython that produces the colourful tracebacks.