Skip to content

Commit 0e7691b

Browse files
Use new asyncio support in redis package (Fixes #911)
1 parent 16243e7 commit 0e7691b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/socketio/asyncio_redis_manager.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
import pickle
33

44
try:
5-
import aioredis
5+
from redis import asyncio as aioredis
66
except ImportError:
7-
aioredis = None
7+
try:
8+
import aioredis
9+
except ImportError:
10+
aioredis = None
811

912
from .asyncio_pubsub_manager import AsyncPubSubManager
1013

@@ -39,8 +42,7 @@ def __init__(self, url='redis://localhost:6379/0', channel='socketio',
3942
write_only=False, logger=None, redis_options=None):
4043
if aioredis is None:
4144
raise RuntimeError('Redis package is not installed '
42-
'(Run "pip install aioredis" in your '
43-
'virtualenv).')
45+
'(Run "pip install redis" in your virtualenv).')
4446
if not hasattr(aioredis.Redis, 'from_url'):
4547
raise RuntimeError('Version 2 of aioredis package is required.')
4648
self.redis_url = url

0 commit comments

Comments
 (0)