1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
# -*- coding: utf-8 -*-
# python std lib
import sys
# Import shortcut
from .client import RedisCluster
from .pipeline import ClusterPipeline
from .pubsub import ClusterPubSub
# Monkey patch RedisCluster class into redis for easy access
import redis
setattr(redis, "RedisCluster", RedisCluster)
setattr(redis, "ClusterPubSub", ClusterPubSub)
setattr(redis, "ClusterPipeline", ClusterPipeline)
# Major, Minor, Fix version
__version__ = (2, 0, 0)
def int_or_str(value):
try:
return int(value)
except ValueError:
return value
__version__ = '2.0.0'
VERSION = tuple(map(int_or_str, __version__.split('.')))
if sys.version_info[0:3] == (3, 4, 0):
raise RuntimeError("CRITICAL: rediscluster do not work with python 3.4.0. Please use 3.4.1 or higher.")
|