diff --git a/kstreams/streams.py b/kstreams/streams.py index 8c2ea807..8001b03e 100644 --- a/kstreams/streams.py +++ b/kstreams/streams.py @@ -1,10 +1,12 @@ import asyncio import inspect import logging +import sys import uuid from functools import update_wrapper from typing import ( Any, + AsyncGenerator, Awaitable, Callable, Dict, @@ -32,6 +34,12 @@ StreamFunc = Callable +if sys.version_info < (3, 10): + + async def anext(async_gen: AsyncGenerator): + return await async_gen.__anext__() + + class Stream: """ Attributes: