From 26e03ca01c952d3229a0366aae9addd6cb776833 Mon Sep 17 00:00:00 2001 From: Sam Mosleh Date: Wed, 20 Oct 2021 13:38:03 +0330 Subject: [PATCH] Use None instead of dict default argument --- src/socketio/asyncio_redis_manager.py | 4 ++-- src/socketio/redis_manager.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/socketio/asyncio_redis_manager.py b/src/socketio/asyncio_redis_manager.py index 73adb44..f6467c8 100644 --- a/src/socketio/asyncio_redis_manager.py +++ b/src/socketio/asyncio_redis_manager.py @@ -36,14 +36,14 @@ class AsyncRedisManager(AsyncPubSubManager): # pragma: no cover name = 'aioredis' def __init__(self, url='redis://localhost:6379/0', channel='socketio', - write_only=False, logger=None, redis_options={}): + write_only=False, logger=None, redis_options=None): if aioredis is None: raise RuntimeError('Redis package is not installed ' '(Run "pip install aioredis" in your ' 'virtualenv).') if not hasattr(aioredis.Redis, 'from_url'): raise RuntimeError('Version 2 of aioredis package is required.') - self.redis = aioredis.Redis.from_url(url, **redis_options) + self.redis = aioredis.Redis.from_url(url, **(redis_options or {})) self.pubsub = self.redis.pubsub(ignore_subscribe_messages=True) super().__init__(channel=channel, write_only=write_only, logger=logger) diff --git a/src/socketio/redis_manager.py b/src/socketio/redis_manager.py index ebaa347..6625fe2 100644 --- a/src/socketio/redis_manager.py +++ b/src/socketio/redis_manager.py @@ -37,12 +37,12 @@ class RedisManager(PubSubManager): # pragma: no cover name = 'redis' def __init__(self, url='redis://localhost:6379/0', channel='socketio', - write_only=False, logger=None, redis_options={}): + write_only=False, logger=None, redis_options=None): if redis is None: raise RuntimeError('Redis package is not installed ' '(Run "pip install redis" in your ' 'virtualenv).') - self.redis = redis.Redis.from_url(url, **redis_options) + self.redis = redis.Redis.from_url(url, **(redis_options or {})) self.pubsub = self.redis.pubsub(ignore_subscribe_messages=True) super(RedisManager, self).__init__(channel=channel, write_only=write_only,