Skip to content

Commit

Permalink
gh-101517: Add regression test for a lineno bug in try/except* impact…
Browse files Browse the repository at this point in the history
…ing pdb (#103547)
  • Loading branch information
gaogaotiantian authored Apr 14, 2023
1 parent 3d71b5e commit 7c1b0a4
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Lib/test/test_pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1700,6 +1700,26 @@ def test_pdb_issue_gh_103225():
(Pdb) continue
"""

def test_pdb_issue_gh_101517():
"""See GH-101517
Make sure pdb doesn't crash when the exception is caught in a try/except* block
>>> def test_function():
... try:
... raise KeyError
... except* Exception as e:
... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
>>> with PdbTestInput([ # doctest: +NORMALIZE_WHITESPACE
... 'continue'
... ]):
... test_function()
--Return--
> <doctest test.test_pdb.test_pdb_issue_gh_101517[0]>(None)test_function()->None
(Pdb) continue
"""


@support.requires_subprocess()
class PdbTestCase(unittest.TestCase):
Expand Down

0 comments on commit 7c1b0a4

Please sign in to comment.