diff --git a/erasmus/service_manager.py b/erasmus/service_manager.py index 70464608..9aaaf67e 100644 --- a/erasmus/service_manager.py +++ b/erasmus/service_manager.py @@ -2,7 +2,7 @@ import asyncio import logging -from typing import TYPE_CHECKING, Any, Final, TypeGuard, cast +from typing import TYPE_CHECKING, Any, Final, cast from attrs import field, frozen @@ -14,6 +14,8 @@ ) if TYPE_CHECKING: + from typing_extensions import TypeIs + import aiohttp from .config import Config @@ -24,7 +26,7 @@ _log: Final = logging.getLogger(__name__) -def _is_service_cls(obj: object, /) -> TypeGuard[type[BaseService]]: +def _is_service_cls(obj: object, /) -> TypeIs[type[BaseService]]: return hasattr(obj, 'from_config') and callable(cast(Any, obj).from_config)