summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy McCurdy <andy@andymccurdy.com>2018-11-05 12:07:14 -0800
committerAndy McCurdy <andy@andymccurdy.com>2018-11-05 12:07:14 -0800
commitf1169b5fbae225032cdca69ed801f880e3ab83df (patch)
treeba620c666615f52c5442adce6d060bc3d32b0256
parente31f8fbfb673f6b35406992ff3cbb36fd4a50d63 (diff)
downloadredis-py-error_defaults.tar.gz
rename empty_errow -> empty_response as the value is the actual responseerror_defaults
-rwxr-xr-xredis/client.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/redis/client.py b/redis/client.py
index e1f1103..13aa689 100755
--- a/redis/client.py
+++ b/redis/client.py
@@ -26,7 +26,7 @@ from redis.exceptions import (
)
SYM_EMPTY = b('')
-EMPTY_ERROR = 'EMPTY_ERROR'
+EMPTY_RESPONSE = 'EMPTY_RESPONSE'
def list_or_args(keys, args):
@@ -761,8 +761,8 @@ class StrictRedis(object):
try:
response = connection.read_response()
except ResponseError:
- if EMPTY_ERROR in options:
- return options[EMPTY_ERROR]
+ if EMPTY_RESPONSE in options:
+ return options[EMPTY_RESPONSE]
raise
if command_name in self.response_callbacks:
return self.response_callbacks[command_name](response, **options)
@@ -1128,7 +1128,7 @@ class StrictRedis(object):
args = list_or_args(keys, args)
options = {}
if not args:
- options[EMPTY_ERROR] = []
+ options[EMPTY_RESPONSE] = []
return self.execute_command('MGET', *args, **options)
def mset(self, *args, **kwargs):
@@ -3224,7 +3224,7 @@ class BasePipeline(object):
def _execute_transaction(self, connection, commands, raise_on_error):
cmds = chain([(('MULTI', ), {})], commands, [(('EXEC', ), {})])
all_cmds = connection.pack_commands([args for args, options in cmds
- if EMPTY_ERROR not in options])
+ if EMPTY_RESPONSE not in options])
connection.send_packed_command(all_cmds)
errors = []
@@ -3239,8 +3239,8 @@ class BasePipeline(object):
# and all the other commands
for i, command in enumerate(commands):
- if EMPTY_ERROR in command[1]:
- errors.append((i, command[1][EMPTY_ERROR]))
+ if EMPTY_RESPONSE in command[1]:
+ errors.append((i, command[1][EMPTY_RESPONSE]))
else:
try:
self.parse_response(connection, '_')