mirror of
https://github.com/python/cpython.git
synced 2025-10-07 07:31:46 +00:00
bpo-39764: Make Task.get_stack accept ag_frame (#18669)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
This commit is contained in:
parent
1382c3289b
commit
4482337dec
3 changed files with 26 additions and 3 deletions
|
@ -1191,5 +1191,20 @@ class AsyncGenAsyncioTest(unittest.TestCase):
|
|||
|
||||
self.loop.run_until_complete(run())
|
||||
|
||||
def test_async_gen_aclose_compatible_with_get_stack(self):
|
||||
async def async_generator():
|
||||
yield object()
|
||||
|
||||
async def run():
|
||||
ag = async_generator()
|
||||
asyncio.create_task(ag.aclose())
|
||||
tasks = asyncio.all_tasks()
|
||||
for task in tasks:
|
||||
# No AttributeError raised
|
||||
task.get_stack()
|
||||
|
||||
self.loop.run_until_complete(run())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue