info = sys.exc_info()
print(type(e)) # <class 'traceback'>
help(traceback) # NameError: name 'traceback' is not defined
traceback object is an instance of
TracebackType present under types module.
The type of
tracebackobjects such as found in
>>> from types import TracebackType >>> isinstance(info, TracebackType) True >>> TracebackType <class 'traceback'>
As pointed out by @user2357112 the name
TracebackType is basically an alias to the internal
traceback type and is set by raising an exception in types module. The actual
traceback type can be found in CPython code.