diff options
| author | Andy McCurdy <andy@andymccurdy.com> | 2011-03-14 13:16:29 -0700 |
|---|---|---|
| committer | Andy McCurdy <andy@andymccurdy.com> | 2011-03-14 13:16:29 -0700 |
| commit | 47d8b688fd75f6b5d047941a884fbc9a41be300b (patch) | |
| tree | e260d6a2a33466ca20b6e5205a746285af4bbb56 | |
| parent | 459b5a1f04cc69d42a395b82c6879db63298d872 (diff) | |
| download | redis-py-47d8b688fd75f6b5d047941a884fbc9a41be300b.tar.gz | |
Fix for #103, handling socket errors better
| -rw-r--r-- | redis/connection.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/redis/connection.py b/redis/connection.py index 648f7a1..9bacb53 100644 --- a/redis/connection.py +++ b/redis/connection.py @@ -57,8 +57,8 @@ class BaseConnection(object): except socket.error, e: if e.args[0] == errno.EPIPE: self.disconnect() - if isinstance(e.args, basestring): - _errno, errmsg = 'UNKNOWN', e.args + if len(e.args) == 1: + _errno, errmsg = 'UNKNOWN', e.args[0] else: _errno, errmsg = e.args raise ConnectionError("Error %s while writing to socket. %s." % \ |
