From 96d5d8ca144bc2d970c4598696d8c5c7fad85615 Mon Sep 17 00:00:00 2001 From: Mykhailo Keda Date: Sat, 25 Nov 2023 12:34:24 +0000 Subject: [PATCH] Added support for redis as a new replacement for aioredis --- sanic_session/aioredis.py | 8 ++++++-- setup.py | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sanic_session/aioredis.py b/sanic_session/aioredis.py index 42e42d0..ac8206c 100644 --- a/sanic_session/aioredis.py +++ b/sanic_session/aioredis.py @@ -1,9 +1,13 @@ from sanic_session.base import BaseSessionInterface try: - import aioredis + # redis was merged with aioredis https://github.com/redis/redis-py/releases/tag/v4.2.0rc1 + from redis import asyncio as aioredis except ImportError: - aioredis = None + try: + import aioredis + except ImportError: + aioredis = None class AIORedisSessionInterface(BaseSessionInterface): diff --git a/setup.py b/setup.py index 68f1125..cadb321 100644 --- a/setup.py +++ b/setup.py @@ -64,6 +64,7 @@ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy",