FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-124703: Set return code to 1 when aborting process from pdb by gaogaotiantian · Pull Request #133013 · python/cpython · GitHub

/ cpython Public
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) .rst  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 1 addition & 1 deletion Lib/pdb.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1834,7 +1834,7 @@ def do_quit(self, arg):
reply = 'y'
self.message('')
if reply == 'y' or reply == '':
sys.exit(0)
sys.exit(1)
elif reply.lower() == 'n':
return

Expand Down
4 changes: 2 additions & 2 deletions Lib/test/test_pdb.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -4453,7 +4453,7 @@ def test_quit(self):
y
"""

stdout, stderr = self._run_script(script, commands)
stdout, stderr = self._run_script(script, commands, expected_returncode=1)
self.assertIn("2", stdout)
self.assertIn("Quit anyway", stdout)
# Closing stdin will quit the debugger anyway so we need to confirm
Expand Down Expand Up @@ -4483,7 +4483,7 @@ def test_quit_after_interact(self):
y
"""

stdout, stderr = self._run_script(script, commands)
stdout, stderr = self._run_script(script, commands, expected_returncode=1)
# Normal exit should not print anything to stderr
self.assertEqual(stderr, "")
# The quit prompt should be printed exactly once
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Set return code to ``1`` when aborting process from :mod:`pdb`.

Back | FazBrowse Home | New Git URL