Skip to content
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
remove "else"
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
  • Loading branch information
iritkatriel and jaraco authored Jul 1, 2021
commit 6acaeadd1499a6d7759abc78652786763af2ab5d
5 changes: 2 additions & 3 deletions Lib/pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1730,9 +1730,8 @@ def main():
pdb.interaction(None, t)
if pdb._user_requested_quit:
break
Comment on lines +1731 to +1732

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After experimenting, I understand the motivation for this change here, but I also worry that it might affect other workflows we haven't considered. Could there be other use-cases where a different Exception occurred and pdb._user_requested_quit is True, but we would want that to fall through (not break)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. self._user_requested_quit will be True only when we get quit()/exit() or EOF. ISTM that it's safe to exit in both cases.

I'm pretty sure I've had to kill pdb processes in the past, when they stopped responding to quit(), so I would guess it's more likely that there are other code paths that would benefit from this change.

else:
print("Post mortem debugger finished. The " + mainpyfile +
" will be restarted")
print("Post mortem debugger finished. The " + mainpyfile +
" will be restarted")


# When invoked as main program, invoke the debugger on a script
Expand Down