Version history
---------------
+[3.0.2] - 2022-01-20
+
+* Bump Redis client version to 4.1.1 and replace deprecated Redis client '_compat'
+ module with 'utils' module.
+
[3.0.1] - 2021-11-18
* Add specific package versions for required dependencies: redis==3.5.3 and
from redis import Redis
from redis.sentinel import Sentinel
from redis.lock import Lock
-from redis._compat import nativestr
+from redis.utils import str_if_bytes
from redis import exceptions as redis_exceptions
from ricsdl.configuration import _Configuration
from ricsdl.exceptions import (
Adapted from: https://github.com/andymccurdy/redis-py/blob/master/redis/client.py
"""
- message_type = nativestr(response[0])
+ message_type = str_if_bytes(response[0])
if message_type == 'pmessage':
message = {
'type': message_type,
new_sentinel = Sentinel([sentinel_node])
new_redis = new_sentinel.master_for(master_name)
- new_redis.set_response_callback('SETIE', lambda r: r and nativestr(r) == 'OK' or False)
+ new_redis.set_response_callback('SETIE', lambda r: r and str_if_bytes(r) == 'OK' or False)
new_redis.set_response_callback('DELIE', lambda r: r and int(r) == 1 or False)
redis_pubsub = PubSub(self.event_separator, new_redis.connection_pool, ignore_subscribe_messages=True)