mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Issue #16180: Exit pdb if file has syntax error, instead of trapping user
in an infinite loop. Patch by Xavier de Gaye.
This commit is contained in:
parent
6fb5bae252
commit
ca3f435fe6
3 changed files with 18 additions and 0 deletions
|
@ -1669,6 +1669,9 @@ def main():
|
|||
# In most cases SystemExit does not warrant a post-mortem session.
|
||||
print("The program exited via sys.exit(). Exit status:", end=' ')
|
||||
print(sys.exc_info()[1])
|
||||
except SyntaxError:
|
||||
traceback.print_exc()
|
||||
sys.exit(1)
|
||||
except:
|
||||
traceback.print_exc()
|
||||
print("Uncaught exception. Entering post mortem debugging")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue