diff --git a/fakeredis/_valkey.py b/fakeredis/_valkey.py index e1c2e828..5e773f88 100644 --- a/fakeredis/_valkey.py +++ b/fakeredis/_valkey.py @@ -1,9 +1,15 @@ -from typing import Any, Self, Dict +import sys +from typing import Any, Dict from . import FakeStrictRedis from ._connection import FakeRedis from .aioredis import FakeRedis as FakeAsyncRedis +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + def _validate_server_type(args_dict: Dict[str, Any]) -> None: if "server_type" in args_dict and args_dict["server_type"] != "valkey":