[Misc] Upgrade more code to Python 3.10 (#26463)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
Cyrus Leung
2025-10-09 17:43:53 +08:00
committed by GitHub
parent e4791438ed
commit dc7976dd9f
7 changed files with 16 additions and 33 deletions

View File

@@ -75,8 +75,7 @@ async def test_merge_async_iterators():
for iterator in iterators:
try:
# Can use anext() in python >= 3.10
await asyncio.wait_for(iterator.__anext__(), 1)
await asyncio.wait_for(anext(iterator), 1)
except StopAsyncIteration:
# All iterators should be cancelled and print this message.
print("Iterator was cancelled normally")