summaryrefslogtreecommitdiff
path: root/redis
diff options
context:
space:
mode:
Diffstat (limited to 'redis')
-rw-r--r--redis/asyncio/client.py5
-rw-r--r--redis/asyncio/cluster.py4
-rwxr-xr-xredis/client.py5
3 files changed, 14 insertions, 0 deletions
diff --git a/redis/asyncio/client.py b/redis/asyncio/client.py
index 6e66faa..619ee11 100644
--- a/redis/asyncio/client.py
+++ b/redis/asyncio/client.py
@@ -501,12 +501,17 @@ class Redis(
try:
if NEVER_DECODE in options:
response = await connection.read_response(disable_decoding=True)
+ options.pop(NEVER_DECODE)
else:
response = await connection.read_response()
except ResponseError:
if EMPTY_RESPONSE in options:
return options[EMPTY_RESPONSE]
raise
+
+ if EMPTY_RESPONSE in options:
+ options.pop(EMPTY_RESPONSE)
+
if command_name in self.response_callbacks:
# Mypy bug: https://github.com/python/mypy/issues/10977
command_name = cast(str, command_name)
diff --git a/redis/asyncio/cluster.py b/redis/asyncio/cluster.py
index 8abb072..97f4151 100644
--- a/redis/asyncio/cluster.py
+++ b/redis/asyncio/cluster.py
@@ -934,6 +934,7 @@ class ClusterNode:
try:
if NEVER_DECODE in kwargs:
response = await connection.read_response(disable_decoding=True)
+ kwargs.pop(NEVER_DECODE)
else:
response = await connection.read_response()
except ResponseError:
@@ -941,6 +942,9 @@ class ClusterNode:
return kwargs[EMPTY_RESPONSE]
raise
+ if EMPTY_RESPONSE in kwargs:
+ kwargs.pop(EMPTY_RESPONSE)
+
# Return response
if command in self.response_callbacks:
return self.response_callbacks[command](response, **kwargs)
diff --git a/redis/client.py b/redis/client.py
index c1fe9cb..6a26d28 100755
--- a/redis/client.py
+++ b/redis/client.py
@@ -1258,12 +1258,17 @@ class Redis(AbstractRedis, RedisModuleCommands, CoreCommands, SentinelCommands):
try:
if NEVER_DECODE in options:
response = connection.read_response(disable_decoding=True)
+ options.pop(NEVER_DECODE)
else:
response = connection.read_response()
except ResponseError:
if EMPTY_RESPONSE in options:
return options[EMPTY_RESPONSE]
raise
+
+ if EMPTY_RESPONSE in options:
+ options.pop(EMPTY_RESPONSE)
+
if command_name in self.response_callbacks:
return self.response_callbacks[command_name](response, **options)
return response