mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
gh-124703: Set return code to 1 when aborting process from pdb (#133013)
This commit is contained in:
parent
ee033d4555
commit
4f18916c5c
3 changed files with 4 additions and 3 deletions
|
@ -1834,7 +1834,7 @@ class Pdb(bdb.Bdb, cmd.Cmd):
|
|||
reply = 'y'
|
||||
self.message('')
|
||||
if reply == 'y' or reply == '':
|
||||
sys.exit(0)
|
||||
sys.exit(1)
|
||||
elif reply.lower() == 'n':
|
||||
return
|
||||
|
||||
|
|
|
@ -4453,7 +4453,7 @@ class PdbTestInline(unittest.TestCase):
|
|||
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
|
||||
|
@ -4483,7 +4483,7 @@ class PdbTestInline(unittest.TestCase):
|
|||
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
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Set return code to ``1`` when aborting process from :mod:`pdb`.
|
Loading…
Add table
Add a link
Reference in a new issue