mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
gh-84583: Make pdb enter post-mortem mode even for SyntaxError (#110883)
This commit is contained in:
parent
84b7e9e3fa
commit
fa18b0afe4
3 changed files with 20 additions and 7 deletions
|
@ -2151,9 +2151,6 @@ def main():
|
|||
while True:
|
||||
try:
|
||||
pdb._run(target)
|
||||
if pdb._user_requested_quit:
|
||||
break
|
||||
print("The program finished and will be restarted")
|
||||
except Restart:
|
||||
print("Restarting", target, "with arguments:")
|
||||
print("\t" + " ".join(sys.argv[1:]))
|
||||
|
@ -2161,9 +2158,6 @@ def main():
|
|||
# In most cases SystemExit does not warrant a post-mortem session.
|
||||
print("The program exited via sys.exit(). Exit status:", end=' ')
|
||||
print(e)
|
||||
except SyntaxError:
|
||||
traceback.print_exc()
|
||||
sys.exit(1)
|
||||
except BaseException as e:
|
||||
traceback.print_exc()
|
||||
print("Uncaught exception. Entering post mortem debugging")
|
||||
|
@ -2171,6 +2165,9 @@ def main():
|
|||
pdb.interaction(None, e)
|
||||
print("Post mortem debugger finished. The " + target +
|
||||
" will be restarted")
|
||||
if pdb._user_requested_quit:
|
||||
break
|
||||
print("The program finished and will be restarted")
|
||||
|
||||
|
||||
# When invoked as main program, invoke the debugger on a script
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue