Skip to content

Commit c24376e

Browse files
Allow partial backward-compatibility with aioredis, with warning (#766)
1 parent 5695c12 commit c24376e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

aiohttp_session/redis_storage.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@
99
try:
1010
from redis import VERSION as REDIS_VERSION, asyncio as aioredis
1111
except ImportError: # pragma: no cover
12-
aioredis = None # type: ignore[assignment]
12+
try:
13+
import aioredis # type: ignore[import, no-redef] # noqa: I900
14+
except ImportError:
15+
aioredis = None # type: ignore[assignment]
16+
else:
17+
import warnings
18+
warnings.warn("aioredis library is deprecated, please replace with redis.",
19+
DeprecationWarning)
20+
REDIS_VERSION = (4, 3)
1321

1422

1523
class RedisStorage(AbstractStorage):

0 commit comments

Comments
 (0)