answered 2019-05-18 09:28:57 +0200
You should probably look at IPython.core.ultratb . It looks like that's the part of IPython that produces the colourful tracebacks.