From 6a69aa50797f95b8fd426651ac0b27d7718036d9 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 6 Jun 2013 11:30:23 -0700 Subject: encoding tests --- redis/utils.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'redis/utils.py') diff --git a/redis/utils.py b/redis/utils.py index 7c04a71..ee681bf 100644 --- a/redis/utils.py +++ b/redis/utils.py @@ -1,10 +1,16 @@ -from redis.client import Redis +try: + import hiredis + HIREDIS_AVAILABLE = True +except ImportError: + HIREDIS_AVAILABLE = False def from_url(url, db=None, **kwargs): - """Returns an active Redis client generated from the given database URL. + """ + Returns an active Redis client generated from the given database URL. Will attempt to extract the database id from the path url fragment, if none is provided. """ + from redis.client import Redis return Redis.from_url(url, db, **kwargs) -- cgit v1.2.1