Skip to content

Latest commit

 

History

History
53 lines (36 loc) · 708 Bytes

README.md

File metadata and controls

53 lines (36 loc) · 708 Bytes

ei

Automatically embed IPython into arbitrary stack frames in traceback.

asciicast

Install

# PyPI
pip3 install ei

# GitHub
pip3 install git+https://github.saobby.my.eu.org.djosix/ei.git

Usage

Basic usage:

def main():
    a = 123
    b = 0
    return a / b

if __name__ == '__main__':
    import ei
    ei.patch() # overwrites sys.excepthook

    main()

Unpatch to recover sys.excepthook:

ei.unpatch()

Context manager:

with ei.capture():
    main()

# The exception hook is recovered here

Lazy patch:

import ei.patched