summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy McCurdy <andy@andymccurdy.com>2019-02-01 11:28:15 -0800
committerGitHub <noreply@github.com>2019-02-01 11:28:15 -0800
commita4644592162afdfe5b8809fa28eff041f7be6993 (patch)
tree30905c9b6e56ec1f8b9381bb12735f3d89a03872
parentff17e924e8037e3b528ac93654ddc6be410b0e16 (diff)
parentf767b464c8fbb039d058dbff43bbdef6b2987476 (diff)
downloadredis-py-a4644592162afdfe5b8809fa28eff041f7be6993.tar.gz
Merge pull request #1129 from Chronial/feature/fix-except
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 f0fa43b..f631cab 100755
--- a/redis/connection.py
+++ b/redis/connection.py
@@ -609,9 +609,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"
@@ -630,9 +630,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