From 769f976326a54ce5bb40b86271882cdd71700cb1 2013-07-26 01:07:07 From: MinRK Date: 2013-07-26 01:07:07 Subject: [PATCH] catch KeyboardInterrupt in debug avoids traceback for ^C in ipdb. also prevents KeyboardInterrupt from exiting debugger. Is this actually desirable? --- diff --git a/IPython/core/debugger.py b/IPython/core/debugger.py index 6b214a3..ad6e93e 100644 --- a/IPython/core/debugger.py +++ b/IPython/core/debugger.py @@ -263,7 +263,13 @@ class Pdb(OldPdb): def interaction(self, frame, traceback): self.shell.set_completer_frame(frame) - OldPdb.interaction(self, frame, traceback) + while True: + try: + OldPdb.interaction(self, frame, traceback) + except KeyboardInterrupt: + self.shell.write("\nKeyboardInterrupt\n") + else: + break def new_do_up(self, arg): OldPdb.do_up(self, arg)