From fe056c79d5ada1a3b8f8550ed60a7b084a5fcda4 2015-10-10 19:00:49 From: memeplex Date: 2015-10-10 19:00:49 Subject: [PATCH] Fix #8077 for non-quit pdb exits. --- diff --git a/IPython/core/debugger.py b/IPython/core/debugger.py index 8b5f2b9..c5548e4 100644 --- a/IPython/core/debugger.py +++ b/IPython/core/debugger.py @@ -282,11 +282,13 @@ class Pdb(OldPdb): while True: try: OldPdb.interaction(self, frame, traceback) + break except KeyboardInterrupt: self.shell.write('\n' + self.shell.get_exception_only()) break - else: - break + finally: + # Pdb sets readline delimiters, so set them back to our own + self.shell.readline.set_completer_delims(self.shell.readline_delims) def new_do_up(self, arg): OldPdb.do_up(self, arg) @@ -308,10 +310,6 @@ class Pdb(OldPdb): if hasattr(self, 'old_all_completions'): self.shell.Completer.all_completions=self.old_all_completions - # Pdb sets readline delimiters, so set them back to our own - if self.shell.readline is not None: - self.shell.readline.set_completer_delims(self.shell.readline_delims) - return OldPdb.do_quit(self, arg) do_q = do_quit = decorate_fn_with_doc(new_do_quit, OldPdb.do_quit)