mirror of
https://github.com/python/cpython.git
synced 2025-11-01 02:38:53 +00:00
gh-109371: Fix monitoring with instruction events set (gh-109385)
This commit is contained in:
parent
23f9f6f464
commit
412f5e85d6
4 changed files with 33 additions and 2 deletions
|
|
@ -439,7 +439,6 @@ class TestEdgeCases(unittest.TestCase):
|
|||
sys.setprofile(foo)
|
||||
self.assertEqual(sys.getprofile(), bar)
|
||||
|
||||
|
||||
def test_same_object(self):
|
||||
def foo(*args):
|
||||
...
|
||||
|
|
@ -448,6 +447,18 @@ class TestEdgeCases(unittest.TestCase):
|
|||
del foo
|
||||
sys.setprofile(sys.getprofile())
|
||||
|
||||
def test_profile_after_trace_opcodes(self):
|
||||
def f():
|
||||
...
|
||||
|
||||
sys._getframe().f_trace_opcodes = True
|
||||
prev_trace = sys.gettrace()
|
||||
sys.settrace(lambda *args: None)
|
||||
f()
|
||||
sys.settrace(prev_trace)
|
||||
sys.setprofile(lambda *args: None)
|
||||
f()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue