diff options
author | Andy McCurdy <andy@andymccurdy.com> | 2013-04-22 15:05:46 -0700 |
---|---|---|
committer | Andy McCurdy <andy@andymccurdy.com> | 2013-04-22 15:05:46 -0700 |
commit | 69b84010fbd495e210887df75fb8b56bcba41a57 (patch) | |
tree | aaa32a1b3a30bc50665f53dcd1e1a9de166c7ef1 /redis/client.py | |
parent | 441ac15a3f8c2968ae7de0990703ee44c7d24f09 (diff) | |
parent | 99e10b1f4f789d7ad1ddbad7369225f88fc3974d (diff) | |
download | redis-py-69b84010fbd495e210887df75fb8b56bcba41a57.tar.gz |
Merge pull request #338 from stephan-hof/corrupted_pipeline_socket
socket gets corrupted if errors in pipeline happen
Diffstat (limited to 'redis/client.py')
-rw-r--r-- | redis/client.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/redis/client.py b/redis/client.py index 0369d30..d9506e6 100644 --- a/redis/client.py +++ b/redis/client.py @@ -1794,8 +1794,15 @@ class BasePipeline(object): starmap(connection.pack_command, [args for args, options in commands])) connection.send_packed_command(all_cmds) - response = [self.parse_response(connection, args[0], **options) - for args, options in commands] + + response = [] + for args, options in commands: + try: + response.append( + self.parse_response(connection, args[0], **options)) + except ResponseError: + response.append(sys.exc_info()[1]) + if raise_on_error: self.raise_first_error(response) return response |