GH-128534: Fix behavior of branch monitoring for async for (GH-130847)

* Both branches in a pair now have a common source and are included in co_branches
This commit is contained in:
Mark Shannon 2025-03-07 14:30:31 +00:00 committed by GitHub
parent e5527f2cdd
commit 89df62c120
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 235 additions and 154 deletions

View file

@ -953,6 +953,15 @@ class CodeLocationTest(unittest.TestCase):
get_line_branches(with_extended_args),
[(1,2,8)])
async def afunc():
async for letter in async_iter1:
2
3
self.assertEqual(
get_line_branches(afunc),
[(1,1,3)])
if check_impl_detail(cpython=True) and ctypes is not None:
py = ctypes.pythonapi
freefunc = ctypes.CFUNCTYPE(None,ctypes.c_voidp)