Skip to content

Commit fe056c7

Browse files
committed
Fix ipython#8077 for non-quit pdb exits.
1 parent e1e7710 commit fe056c7

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

‎IPython/core/debugger.py‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,13 @@ def interaction(self, frame, traceback):
282282
while True:
283283
try:
284284
OldPdb.interaction(self, frame, traceback)
285+
break
285286
except KeyboardInterrupt:
286287
self.shell.write('\n' + self.shell.get_exception_only())
287288
break
288-
else:
289-
break
289+
finally:
290+
# Pdb sets readline delimiters, so set them back to our own
291+
self.shell.readline.set_completer_delims(self.shell.readline_delims)
290292

291293
def new_do_up(self, arg):
292294
OldPdb.do_up(self, arg)
@@ -308,10 +310,6 @@ def new_do_quit(self, arg):
308310
if hasattr(self, 'old_all_completions'):
309311
self.shell.Completer.all_completions=self.old_all_completions
310312

311-
# Pdb sets readline delimiters, so set them back to our own
312-
if self.shell.readline is not None:
313-
self.shell.readline.set_completer_delims(self.shell.readline_delims)
314-
315313
return OldPdb.do_quit(self, arg)
316314

317315
do_q = do_quit = decorate_fn_with_doc(new_do_quit, OldPdb.do_quit)

0 commit comments

Comments
 (0)