Skip to content

Commit

Permalink
raise TimeoutError if a socket.timeout is raised while connecting
Browse files Browse the repository at this point in the history
fixes redis#675
  • Loading branch information
andymccurdy committed Nov 9, 2015
1 parent d91308b commit 1c20717
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions redis/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,8 @@ def connect(self):
return
try:
sock = self._connect()
except socket.timeout:
raise TimeoutError("Timeout connecting to server")
except socket.error:
e = sys.exc_info()[1]
raise ConnectionError(self._error_message(e))
Expand Down

0 comments on commit 1c20717

Please sign in to comment.