summaryrefslogtreecommitdiffstats
path: root/Lib/pdb.py
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2015-09-05 23:13:26 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2015-09-05 23:13:26 (GMT)
commitca3f435fe6b5de970848eb3a5d8f8e6cd5d2f73c (patch)
treeaf703be82111b458922d8376f9189fde9ae4c729 /Lib/pdb.py
parent6fb5bae252b90b81dff19f572fe40a9051e5e51d (diff)
downloadcpython-ca3f435fe6b5de970848eb3a5d8f8e6cd5d2f73c.zip
cpython-ca3f435fe6b5de970848eb3a5d8f8e6cd5d2f73c.tar.gz
cpython-ca3f435fe6b5de970848eb3a5d8f8e6cd5d2f73c.tar.bz2
Issue #16180: Exit pdb if file has syntax error, instead of trapping user
in an infinite loop. Patch by Xavier de Gaye.
Diffstat (limited to 'Lib/pdb.py')
-rwxr-xr-xLib/pdb.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/pdb.py b/Lib/pdb.py
index e28564b..7d58c2a 100755
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -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")