
from .default import DefaultClient
from .sharded import ShardClient
from .herd import HerdClient
from .experimental import SimpleFailoverClient
from .sentinel import SentinelClient

__all__ = ['DefaultClient', 'ShardClient',
           'HerdClient', 'SimpleFailoverClient',
           'SentinelClient']


import warnings

from .default import DefaultClient
from .sharded import ShardClient
from .herd import HerdClient
from .experimental import SimpleFailoverClient


__all__ = ['DefaultClient', 'ShardClient',
           'HerdClient', 'SimpleFailoverClient',]

try:
    from .sentinel import SentinelClient
    __all__.append("SentinelClient")
except ImportError:
    warnings.warn("sentinel client is unsuported with redis-py<2.9",
                  RuntimeWarning)


Disable Sentinel client with redis-py < 2.9
Disable Sentinel client with redis-py < 2.9

+ 
+ import warnings
  
  from .default import DefaultClient
  from .sharded import ShardClient
  from .herd import HerdClient
  from .experimental import SimpleFailoverClient
- from .sentinel import SentinelClient
+ 
  
  __all__ = ['DefaultClient', 'ShardClient',
-            'HerdClient', 'SimpleFailoverClient',
+            'HerdClient', 'SimpleFailoverClient',]
-            'SentinelClient']
  
+ try:
+     from .sentinel import SentinelClient
+     __all__.append("SentinelClient")
+ except ImportError:
+     warnings.warn("sentinel client is unsuported with redis-py<2.9",
+                   RuntimeWarning)
+ 
+ 
Disable Sentinel client with redis-py < 2.9
## Code Before:

from .default import DefaultClient
from .sharded import ShardClient
from .herd import HerdClient
from .experimental import SimpleFailoverClient
from .sentinel import SentinelClient

__all__ = ['DefaultClient', 'ShardClient',
           'HerdClient', 'SimpleFailoverClient',
           'SentinelClient']

## Instruction:
Disable Sentinel client with redis-py < 2.9
## Code After:

import warnings

from .default import DefaultClient
from .sharded import ShardClient
from .herd import HerdClient
from .experimental import SimpleFailoverClient


__all__ = ['DefaultClient', 'ShardClient',
           'HerdClient', 'SimpleFailoverClient',]

try:
    from .sentinel import SentinelClient
    __all__.append("SentinelClient")
except ImportError:
    warnings.warn("sentinel client is unsuported with redis-py<2.9",
                  RuntimeWarning)

