From d6299bc6ebb90fdea8de85acbe02d279b7854175 2016-09-17 08:41:23 From: mbyt Date: 2016-09-17 08:41:23 Subject: [PATCH] enable quitting for -m IPython.terminal.debugger --- diff --git a/IPython/terminal/debugger.py b/IPython/terminal/debugger.py index 821a45b..1c9bf04 100644 --- a/IPython/terminal/debugger.py +++ b/IPython/terminal/debugger.py @@ -86,5 +86,11 @@ def set_trace(frame=None): if __name__ == '__main__': import pdb + # IPython.core.debugger.Pdb.trace_dispatch shall not catch + # bdb.BdbQuit. When started through __main__ and an exeption + # happend after hitting "c", this is needed in order to + # be able to quit the debugging session (see #9950). + old_trace_dispatch = pdb.Pdb.trace_dispatch pdb.Pdb = TerminalPdb + pdb.Pdb.trace_dispatch = old_trace_dispatch pdb.main()