MCPcopy Create free account
hub / github.com/ipython/ipython / init_traceback_handlers

Method init_traceback_handlers

IPython/core/interactiveshell.py:1811–1833  ·  view source on GitHub ↗
(self, custom_exceptions)

Source from the content-addressed store, hash-verified

1809 debugger_cls = Pdb
1810
1811 def init_traceback_handlers(self, custom_exceptions):
1812 # Syntax error handler.
1813 self.SyntaxTB = ultratb.SyntaxTB(color_scheme='NoColor', parent=self)
1814
1815 # The interactive one is initialized with an offset, meaning we always
1816 # want to remove the topmost item in the traceback, which is our own
1817 # internal code. Valid modes: ['Plain','Context','Verbose','Minimal']
1818 self.InteractiveTB = ultratb.AutoFormattedTB(mode = 'Plain',
1819 color_scheme='NoColor',
1820 tb_offset = 1,
1821 check_cache=check_linecache_ipython,
1822 debugger_cls=self.debugger_cls, parent=self)
1823
1824 # The instance will store a pointer to the system-wide exception hook,
1825 # so that runtime code (such as magics) can access it. This is because
1826 # during the read-eval loop, it may get temporarily overwritten.
1827 self.sys_excepthook = sys.excepthook
1828
1829 # and add any custom exception handlers the user may have specified
1830 self.set_custom_exc(*custom_exceptions)
1831
1832 # Set the exception mode
1833 self.InteractiveTB.set_mode(mode=self.xmode)
1834
1835 def set_custom_exc(self, exc_tuple, handler):
1836 """set_custom_exc(exc_tuple, handler)

Callers 1

__init__Method · 0.95

Calls 2

set_custom_excMethod · 0.95
set_modeMethod · 0.80

Tested by

no test coverage detected