From 0fbb18c9599c87354262a7aa5aa93fa2a1e410c0 Mon Sep 17 00:00:00 2001 From: Max Vasterd Date: Fri, 3 Sep 2021 12:59:19 +0200 Subject: [PATCH] if user defaults to None as explicit param, set to empty dict --- src/pyop/storage.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pyop/storage.py b/src/pyop/storage.py index 7d5f1be..b1e21f4 100644 --- a/src/pyop/storage.py +++ b/src/pyop/storage.py @@ -121,6 +121,9 @@ class RedisWrapper(StorageBase): """ def __init__(self, db_uri, collection, ttl=None, options={}): + if options is None: + options = {} + if not _has_redis: raise ImportError("redis module is required but it is not available") self._db = Redis.from_url(db_uri, decode_responses=True, **options.get('redis_kwargs', {}))