From 1e7e952a3121d8313ca940f2d2d35a118d60bd4c Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Sat, 25 Jan 2025 09:18:40 +0000 Subject: [PATCH] simplify test_asyncio.test_taskgroups no_other_refs --- Lib/test/test_asyncio/test_taskgroups.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Lib/test/test_asyncio/test_taskgroups.py b/Lib/test/test_asyncio/test_taskgroups.py index 0d69a436fdb840..3e4f493e5d0e9b 100644 --- a/Lib/test/test_asyncio/test_taskgroups.py +++ b/Lib/test/test_asyncio/test_taskgroups.py @@ -32,11 +32,7 @@ def get_error_types(eg): def no_other_refs(): # due to gh-124392 coroutines now refer to their locals - coro = asyncio.current_task().get_coro() - frame = sys._getframe(1) - while coro.cr_frame != frame: - coro = coro.cr_await - return [coro] + return [sys._getframe(1).f_generator] def set_gc_state(enabled):