Skip to content
Open
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
6 changes: 5 additions & 1 deletion redis/multidb/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
from typing import List, Type, Union

import pybreaker
from typing_extensions import Optional

try:
from typing import Optional # Py 3.11+
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can directly import it from typing and completely remove the typing_extensions import. The typing.Optional is available in our min supported version, which is 3.10

except ImportError:
from typing_extensions import Optional

from redis import ConnectionPool, Redis, RedisCluster
from redis.backoff import ExponentialWithJitterBackoff, NoBackoff
Expand Down
5 changes: 4 additions & 1 deletion redis/multidb/failure_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
from datetime import datetime, timedelta
from typing import List, Type

from typing_extensions import Optional
try:
from typing import Optional # Py 3.11+
except ImportError:
from typing_extensions import Optional

from redis.multidb.circuit import State as CBState

Expand Down