How to use the ipdb.__main__.wrap_sys_excepthook function in ipdb

To help you get started, we’ve selected a few ipdb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dalejung / trtools / trtools / tools / trace.py View on Github external
def set_trace(self, frame=None):
        """
        """
        update_stdout()
        wrap_sys_excepthook()
        if frame is None:
            frame = sys._getframe().f_back
        #pdb = Tdb(def_colors)
        self.reset()
        self.set_step()
        sys.settrace(self.trace_dispatch)
github gregoil / ipdbugger / ipdbugger / __init__.py View on Github external
"""
    exc_type, exc_value, exc_tb = sys.exc_info()

    # If the exception has been annotated to be re-raised, raise the exception
    if hasattr(exc_value, '_ipdbugger_let_raise'):
        raise_(*sys.exc_info())

    print()
    for line in traceback.format_exception(exc_type, exc_value, exc_tb):
        print(colored(line, 'red'), end=' ')

    # Get the frame with the error.
    test_frame = sys._getframe(-1).f_back

    from ipdb.__main__ import wrap_sys_excepthook
    wrap_sys_excepthook()
    IPDBugger(exc_info=sys.exc_info()).set_trace(test_frame)