Skip to content

Commit a464459

Browse files
authored
Merge pull request #1129 from Chronial/feature/fix-except
Do not leave connections in invalid state
2 parents ff17e92 + f767b46 commit a464459

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
@@ -609,9 +609,9 @@ def send_packed_command(self, command):
609609
errmsg = e.args[1]
610610
raise ConnectionError("Error %s while writing to socket. %s." %
611611
(errno, errmsg))
612-
except Exception as e:
612+
except: # noqa: E722
613613
self.disconnect()
614-
raise e
614+
raise
615615

616616
def send_command(self, *args):
617617
"Pack and send a command to the Redis server"
@@ -630,9 +630,9 @@ def read_response(self):
630630
"Read the response from a previously sent command"
631631
try:
632632
response = self._parser.read_response()
633-
except Exception as e:
633+
except: # noqa: E722
634634
self.disconnect()
635-
raise e
635+
raise
636636
if isinstance(response, ResponseError):
637637
raise response
638638
return response

0 commit comments

Comments
 (0)