Skip to content

Commit f767b46

Browse files
committed
Do not leave connections in invalid state
1 parent 2f3afb0 commit f767b46

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

redis/connection.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -610,9 +610,9 @@ def send_packed_command(self, command):
610610
errmsg = e.args[1]
611611
raise ConnectionError("Error %s while writing to socket. %s." %
612612
(errno, errmsg))
613-
except Exception as e:
613+
except: # noqa: E722
614614
self.disconnect()
615-
raise e
615+
raise
616616

617617
def send_command(self, *args):
618618
"Pack and send a command to the Redis server"
@@ -631,9 +631,9 @@ def read_response(self):
631631
"Read the response from a previously sent command"
632632
try:
633633
response = self._parser.read_response()
634-
except Exception as e:
634+
except: # noqa: E722
635635
self.disconnect()
636-
raise e
636+
raise
637637
if isinstance(response, ResponseError):
638638
raise response
639639
return response

0 commit comments

Comments
 (0)