summaryrefslogtreecommitdiffstats
path: root/Lib/pdb.py
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2015-09-05 23:13:17 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2015-09-05 23:13:17 (GMT)
commit23ae488f23c7955a1b3448590d91b758e552764f (patch)
treeb8a9af091401918460d9f1dce47a5a5e8cb302b8 /Lib/pdb.py
parentbda9bd1d1ccd3d40af82e4ec0b7767fe4eb2ad96 (diff)
downloadcpython-23ae488f23c7955a1b3448590d91b758e552764f.zip
cpython-23ae488f23c7955a1b3448590d91b758e552764f.tar.gz
cpython-23ae488f23c7955a1b3448590d91b758e552764f.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 113b4e0..4d35103 100755
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -1322,6 +1322,9 @@ def main():
# In most cases SystemExit does not warrant a post-mortem session.
print "The program exited via sys.exit(). Exit status: ",
print sys.exc_info()[1]
+ except SyntaxError:
+ traceback.print_exc()
+ sys.exit(1)
except:
traceback.print_exc()
print "Uncaught exception. Entering post mortem debugging"