Skip to content

Commit

Permalink
Merge pull request #1129 from Chronial/feature/fix-except
Browse files Browse the repository at this point in the history
Do not leave connections in invalid state
  • Loading branch information
andymccurdy committed Feb 1, 2019
2 parents ff17e92 + f767b46 commit a464459
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions redis/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,9 +609,9 @@ def send_packed_command(self, command):
errmsg = e.args[1]
raise ConnectionError("Error %s while writing to socket. %s." %
(errno, errmsg))
except Exception as e:
except: # noqa: E722
self.disconnect()
raise e
raise

def send_command(self, *args):
"Pack and send a command to the Redis server"
Expand All @@ -630,9 +630,9 @@ def read_response(self):
"Read the response from a previously sent command"
try:
response = self._parser.read_response()
except Exception as e:
except: # noqa: E722
self.disconnect()
raise e
raise
if isinstance(response, ResponseError):
raise response
return response
Expand Down

0 comments on commit a464459

Please sign in to comment.