diff --git a/src/socketio/async_redis_manager.py b/src/socketio/async_redis_manager.py index b91eeb8..b37e905 100644 --- a/src/socketio/async_redis_manager.py +++ b/src/socketio/async_redis_manager.py @@ -20,8 +20,6 @@ except ImportError: # pragma: no cover valkey = None ValkeyError = None - - from .async_pubsub_manager import AsyncPubSubManager from .redis_manager import parse_redis_sentinel_url @@ -59,7 +57,8 @@ class AsyncRedisManager(AsyncPubSubManager): # pragma: no cover write_only=False, logger=None, redis_options=None): if aioredis is None and valkey is None: raise RuntimeError('Redis package is not installed ' - '(Run "pip install redis" or "pip install valkey" ' + '(Run "pip install redis" or ' + '"pip install valkey" ' 'in your virtualenv).') if aioredis and not hasattr(aioredis.Redis, 'from_url'): raise RuntimeError('Version 2 of aioredis package is required.') @@ -74,12 +73,14 @@ class AsyncRedisManager(AsyncPubSubManager): # pragma: no cover if schema == 'redis': if aioredis is None or RedisError is None: raise RuntimeError('Redis package is not installed ' - '(Run "pip install redis" in your virtualenv).') + '(Run "pip install redis" ' + 'in your virtualenv).') return aioredis, RedisError if schema == 'valkey': if valkey is None or ValkeyError is None: raise RuntimeError('Valkey package is not installed ' - '(Run "pip install valkey" in your virtualenv).') + '(Run "pip install valkey" ' + 'in your virtualenv).') return valkey, ValkeyError error_msg = f'Unsupported Redis URL schema: {schema}' raise ValueError(error_msg) diff --git a/src/socketio/redis_manager.py b/src/socketio/redis_manager.py index a0ef30e..1d0227e 100644 --- a/src/socketio/redis_manager.py +++ b/src/socketio/redis_manager.py @@ -82,7 +82,8 @@ class RedisManager(PubSubManager): # pragma: no cover write_only=False, logger=None, redis_options=None): if redis is None and valkey is None: raise RuntimeError('Redis package is not installed ' - '(Run "pip install redis" or "pip install valkey" ' + '(Run "pip install redis" ' + 'or "pip install valkey" ' 'in your virtualenv).') super().__init__(channel=channel, write_only=write_only, logger=logger) self.redis_url = url @@ -110,12 +111,14 @@ class RedisManager(PubSubManager): # pragma: no cover if schema == 'redis': if redis is None or RedisError is None: raise RuntimeError('Redis package is not installed ' - '(Run "pip install redis" in your virtualenv).') + '(Run "pip install redis" ' + 'in your virtualenv).') return redis, RedisError if schema == 'valkey': if valkey is None or ValkeyError is None: raise RuntimeError('Valkey package is not installed ' - '(Run "pip install valkey" in your virtualenv).') + '(Run "pip install valkey" ' + 'in your virtualenv).') return valkey, ValkeyError error_msg = f'Unsupported Redis URL schema: {schema}' raise ValueError(error_msg)