Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
pytest:
strategy:
matrix:
py_version: ["3.10", "3.11", "3.12", "3.13"]
py_version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
pydantic_ver: ["<2", ">=2.5,<3"]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: "${{ matrix.os }}"
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Operating System :: OS Independent",
"Intended Audience :: Developers",
"Topic :: System :: Networking",
Expand Down
9 changes: 8 additions & 1 deletion taskiq/receiver/receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import contextvars
import functools
import inspect
import sys
from collections.abc import Callable
from concurrent.futures import Executor
from logging import getLogger
Expand All @@ -23,6 +24,7 @@
from taskiq.utils import maybe_awaitable

logger = getLogger(__name__)
PY_VERSION = sys.version_info
QUEUE_DONE = b"-1"


Expand Down Expand Up @@ -224,6 +226,11 @@ async def run_task( # noqa: C901, PLR0912, PLR0915
# Start a timer.
start_time = time()

check_coroutine_func = (
asyncio.iscoroutinefunction
if PY_VERSION <= (3, 13)
else inspect.iscoroutinefunction
)
try:
# We put kwargs resolving here,
# to be able to catch any exception (for example ),
Expand All @@ -234,7 +241,7 @@ async def run_task( # noqa: C901, PLR0912, PLR0915
kwargs.update(message.kwargs)
is_coroutine = True
# If the function is a coroutine, we await it.
if asyncio.iscoroutinefunction(target):
if check_coroutine_func(target):
target_future = target(*message.args, **kwargs)
else:
is_coroutine = False
Expand Down