Previously, errors in custom handlers would result in the custom exception
handler's error being printed in lieu of the real exception, and certain cases could cause infinite loops.
Now, if CustomTB fails it is unregistered immediately, and the original TB is also displayed.
IPython's own BdbQuit_IPython_excepthook had an invalid signature, which revealed this issue, and has also been fixed.
Note that pydb has been deprecated, and superseded by pydbgr, which may be
It would be preferable if the Pdb class could inherit from pydb or pdb
based on a runtime flag rather than checking sys.argv at the top level.
This at least restores old behavior for pydb users.