summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pdb.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_pdb.py')
-rw-r--r--Lib/test/test_pdb.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py
index 5508f7b..7cd5ae3 100644
--- a/Lib/test/test_pdb.py
+++ b/Lib/test/test_pdb.py
@@ -2349,6 +2349,31 @@ def test_pdb_issue_gh_108976():
(Pdb) continue
"""
+
+def test_pdb_issue_gh_80731():
+ """See GH-80731
+
+ pdb should correctly print exception info if in an except block.
+
+ >>> with PdbTestInput([ # doctest: +ELLIPSIS
+ ... 'import sys',
+ ... 'sys.exc_info()',
+ ... 'continue'
+ ... ]):
+ ... try:
+ ... raise ValueError('Correct')
+ ... except ValueError:
+ ... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
+ ... pass
+ > <doctest test.test_pdb.test_pdb_issue_gh_80731[0]>(10)<module>()
+ -> pass
+ (Pdb) import sys
+ (Pdb) sys.exc_info()
+ (<class 'ValueError'>, ValueError('Correct'), <traceback object at ...>)
+ (Pdb) continue
+ """
+
+
def test_pdb_ambiguous_statements():
"""See GH-104301