GH-108976. Keep monitoring data structures valid during de-optimization during callback. (GH-109131)

This commit is contained in:
Mark Shannon 2023-09-11 14:37:09 +01:00 committed by GitHub
parent 60b8341d07
commit 4a69301ea4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 79 additions and 55 deletions

View file

@ -2297,6 +2297,24 @@ def test_pdb_issue_gh_101517():
(Pdb) continue
"""
def test_pdb_issue_gh_108976():
"""See GH-108976
Make sure setting f_trace_opcodes = True won't crash pdb
>>> def test_function():
... import sys
... sys._getframe().f_trace_opcodes = True
... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
... a = 1
>>> with PdbTestInput([ # doctest: +NORMALIZE_WHITESPACE
... 'continue'
... ]):
... test_function()
bdb.Bdb.dispatch: unknown debugging event: 'opcode'
> <doctest test.test_pdb.test_pdb_issue_gh_108976[0]>(5)test_function()
-> a = 1
(Pdb) continue
"""
def test_pdb_ambiguous_statements():
"""See GH-104301