8000 gh-124703: Allow the user to choose how to quit pdb in 'inline' mode by ADThomas-astro · Pull Request #129768 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-124703: Allow the user to choose how to quit pdb in 'inline' mode #129768

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Also allow 'q', and add comments
  • Loading branch information
ADThomas-astro committed Feb 7, 2025
commit 229e4193a633f3cfa6ae3bc38675e914ea52486f
6 changes: 5 additions & 1 deletion Lib/pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1734,11 +1734,15 @@ def do_quit(self, arg):
reply = 'e'
self.message('')

if reply == 'e' or reply == '':
if reply in ('e', 'q', ''):
# Will raise BdbQuit and allow returning to REPL
break
elif reply == 'k':
# Kill process. Allows user to break out of infinite loop
# or exit both pdb and REPL when interactive work finished.
sys.exit(0)
elif reply.lower() == 'c':
# Cancel and return to debugger
return

self._user_requested_quit = True
Expand Down
Loading
0