gotcha/ipdb — pull request #28 by marciomazza (2012-07-04 03:22:47+00:00)
Title: Check to wrap sys.excepthook only once

Check first to see if sys.excepthook was already wrapped with
BdbQuit_excepthook before doing so.

If that is made twice end up with
BdbQuit_excepthook.excepthook_ori == BdbQuit_excepthook

But in ipython/IPython/core/debugger.py the code of `BdbQuit_excepthook`
could then enter an infinite loop, because it eventually calls
`BdbQuit_excepthook.excepthook_ori`

After two calls to set_trace, for example, and a random exception to trigger