Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ResponseError.__init__ default values for cmd_line is None

  • Loading branch information...
commit 57f81034eb4817357117efb2909ea09feb90944c 1 parent 1605c75
@evilkost authored
View
4 brukva/client.py
@@ -424,7 +424,7 @@ def consume_bulk(self, length, callback):
if isinstance(data, Exception):
raise data
if not data:
- raise ResponseError('EmptyResponse', None)
+ raise ResponseError('EmptyResponse')
else:
data = data[:-2]
callback(data)
@@ -890,7 +890,7 @@ def execute(self, callbacks):
while len(responses) < total:
data = yield async(self.connection.readline)()
if not data:
- raise ResponseError('Not enough data after EXEC', None)
+ raise ResponseError('Not enough data after EXEC')
try:
cmd_line = cmds.next()
View
5 brukva/exceptions.py
@@ -1,3 +1,6 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
class RedisError(Exception):
pass
@@ -7,7 +10,7 @@ class ConnectionError(RedisError):
class ResponseError(RedisError):
- def __init__(self, message, cmd_line):
+ def __init__(self, message, cmd_line=None):
self.message = message
self.cmd_line = cmd_line
View
5 tests/server_commands.py
@@ -661,6 +661,11 @@ def test_pipe_hsets2(self):
])
self.start()
+ def test_response_error(self):
+ self.client.set('foo', 'bar', self.expect(True))
+ self.client.llen('foo', [self.expect(ResponseError), self.finish])
+ self.start()
+
class PubSubTestCase(TornadoTestCase):
def setUp(self, *args, **kwargs):
super(PubSubTestCase, self).setUp(*args, **kwargs)
Please sign in to comment.
Something went wrong with that request. Please try again.