Skip to content

Commit

Permalink
socket errors on windows contain more than 2 arguments.
Browse files Browse the repository at this point in the history
fixes redis#641
  • Loading branch information
andymccurdy committed Nov 2, 2015
1 parent 10895e2 commit 7c3aab5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions redis/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,11 +548,12 @@ def send_packed_command(self, command):
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
Expand Down

0 comments on commit 7c3aab5

Please sign in to comment.