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 poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ tag_format = "{version}"

[tool.poetry.dependencies]
python = "^3.7"
async-timeout = ">=3.0.1"
async-timeout = {version = ">=3.0.0", python = "<3.11"}
ifaddr = ">=0.1.7"

[tool.poetry.group.dev.dependencies]
Expand Down
8 changes: 6 additions & 2 deletions src/zeroconf/_utils/asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@
import asyncio
import concurrent.futures
import contextlib
import sys
from typing import Any, Awaitable, Coroutine, Optional, Set

import async_timeout
if sys.version_info[:2] < (3, 11):
from async_timeout import timeout as asyncio_timeout
else:
from asyncio import timeout as asyncio_timeout

from .._exceptions import EventLoopBlocked
from ..const import _LOADED_SYSTEM_TIMEOUT
Expand All @@ -40,7 +44,7 @@
async def wait_event_or_timeout(event: asyncio.Event, timeout: float) -> None:
"""Wait for an event or timeout."""
with contextlib.suppress(asyncio.TimeoutError):
async with async_timeout.timeout(timeout):
async with asyncio_timeout(timeout):
await event.wait()


Expand Down