2020 valkey = None
2121 ValkeyError = None
2222
23-
24-
2523from .async_pubsub_manager import AsyncPubSubManager
2624from .redis_manager import parse_redis_sentinel_url
2725
@@ -59,7 +57,8 @@ def __init__(self, url='redis://localhost:6379/0', channel='socketio',
5957 write_only = False , logger = None , redis_options = None ):
6058 if aioredis is None and valkey is None :
6159 raise RuntimeError ('Redis package is not installed '
62- '(Run "pip install redis" or "pip install valkey" '
60+ '(Run "pip install redis" or '
61+ '"pip install valkey" '
6362 'in your virtualenv).' )
6463 if aioredis and not hasattr (aioredis .Redis , 'from_url' ):
6564 raise RuntimeError ('Version 2 of aioredis package is required.' )
@@ -74,12 +73,14 @@ def _get_redis_module_and_error(self):
7473 if schema == 'redis' :
7574 if aioredis is None or RedisError is None :
7675 raise RuntimeError ('Redis package is not installed '
77- '(Run "pip install redis" in your virtualenv).' )
76+ '(Run "pip install redis" '
77+ 'in your virtualenv).' )
7878 return aioredis , RedisError
7979 if schema == 'valkey' :
8080 if valkey is None or ValkeyError is None :
8181 raise RuntimeError ('Valkey package is not installed '
82- '(Run "pip install valkey" in your virtualenv).' )
82+ '(Run "pip install valkey" '
83+ 'in your virtualenv).' )
8384 return valkey , ValkeyError
8485 error_msg = f'Unsupported Redis URL schema: { schema } '
8586 raise ValueError (error_msg )
0 commit comments