(self, custom_exceptions)
| 1960 | debugger_cls = InterruptiblePdb |
| 1961 | |
| 1962 | def init_traceback_handlers(self, custom_exceptions) -> None: |
| 1963 | # Syntax error handler. |
| 1964 | self.SyntaxTB = ultratb.SyntaxTB(theme_name=self.colors) |
| 1965 | |
| 1966 | # The interactive one is initialized with an offset, meaning we always |
| 1967 | # want to remove the topmost item in the traceback, which is our own |
| 1968 | # internal code. Valid modes: ['Plain','Context','Verbose','Minimal'] |
| 1969 | self.InteractiveTB = ultratb.AutoFormattedTB( |
| 1970 | mode=self.xmode, |
| 1971 | theme_name=self.colors, |
| 1972 | tb_offset=1, |
| 1973 | debugger_cls=self.debugger_cls, |
| 1974 | ) |
| 1975 | |
| 1976 | # The instance will store a pointer to the system-wide exception hook, |
| 1977 | # so that runtime code (such as magics) can access it. This is because |
| 1978 | # during the read-eval loop, it may get temporarily overwritten. |
| 1979 | self.sys_excepthook = sys.excepthook |
| 1980 | |
| 1981 | # and add any custom exception handlers the user may have specified |
| 1982 | self.set_custom_exc(*custom_exceptions) |
| 1983 | |
| 1984 | # Set the exception mode |
| 1985 | self.InteractiveTB.set_mode(mode=self.xmode) |
| 1986 | |
| 1987 | def set_custom_exc(self, exc_tuple, handler): |
| 1988 | """set_custom_exc(exc_tuple, handler) |
no test coverage detected