diff options
author | Andy McCurdy <andy@andymccurdy.com> | 2015-11-02 11:25:50 -0800 |
---|---|---|
committer | Andy McCurdy <andy@andymccurdy.com> | 2015-11-02 11:25:50 -0800 |
commit | 7c3aab539d71dbfb87642d85db956c22a7a44a06 (patch) | |
tree | 946ae4a4be3219342aec04086b716b1fa0c5dd9f /redis/connection.py | |
parent | 10895e2a5923895bd10c95cabe07c4f0bfaf811b (diff) | |
download | redis-py-7c3aab539d71dbfb87642d85db956c22a7a44a06.tar.gz |
socket errors on windows contain more than 2 arguments.
fixes #641
Diffstat (limited to 'redis/connection.py')
-rwxr-xr-x | redis/connection.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/redis/connection.py b/redis/connection.py index 6480ab9..8490b85 100755 --- a/redis/connection.py +++ b/redis/connection.py @@ -548,11 +548,12 @@ class Connection(object): e = sys.exc_info()[1] self.disconnect() if len(e.args) == 1: - _errno, errmsg = 'UNKNOWN', e.args[0] + errno, errmsg = 'UNKNOWN', e.args[0] else: - _errno, errmsg = e.args + errno = e.args[0] + errmsg = e.args[1] raise ConnectionError("Error %s while writing to socket. %s." % - (_errno, errmsg)) + (errno, errmsg)) except: self.disconnect() raise |