summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChronial <git@chronial.de>2019-01-30 02:14:00 +0100
committerChronial <git@chronial.de>2019-01-30 02:14:00 +0100
commitf767b464c8fbb039d058dbff43bbdef6b2987476 (patch)
tree9d8dfcb3bc64c53d71eba841f45bc2c9c1fc35ad
parent2f3afb0a2b6adaa7287173f07ea5b7fee8551083 (diff)
downloadredis-py-f767b464c8fbb039d058dbff43bbdef6b2987476.tar.gz
Do not leave connections in invalid state
-rwxr-xr-xredis/connection.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/redis/connection.py b/redis/connection.py
index 0d1c394..1c1b31e 100755
--- a/redis/connection.py
+++ b/redis/connection.py
@@ -610,9 +610,9 @@ class Connection(object):
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"
@@ -631,9 +631,9 @@ class Connection(object):
"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