Skip to content

Commit 8cbd128

Browse files
committed
Revert change to Redis() object
1 parent 6bada77 commit 8cbd128

File tree

2 files changed

+4
-23
lines changed

2 files changed

+4
-23
lines changed

redis/asyncio/client.py

+2-11
Original file line numberDiff line numberDiff line change
@@ -477,17 +477,8 @@ async def _send_command_parse_response(self, conn, command_name, *args, **option
477477
"""
478478
Send a command and parse the response
479479
"""
480-
try:
481-
await conn.send_command(*args)
482-
return await self.parse_response(conn, command_name, **options)
483-
except BaseException:
484-
# An exception while reading or writing leaves the connection in
485-
# an unknown state. There may be un-written or un-read data
486-
# so we cannot re-use it for a subsequent command/response transaction.
487-
# This may be a TimeoutError or any other error not handled by the
488-
# Connection object itself.
489-
await conn.disconnect(nowait=True)
490-
raise
480+
await conn.send_command(*args)
481+
return await self.parse_response(conn, command_name, **options)
491482

492483
async def _disconnect_raise(self, conn: Connection, error: Exception):
493484
"""

redis/client.py

+2-12
Original file line numberDiff line numberDiff line change
@@ -1231,18 +1231,8 @@ def _send_command_parse_response(self, conn, command_name, *args, **options):
12311231
"""
12321232
Send a command and parse the response
12331233
"""
1234-
try:
1235-
conn.send_command(*args)
1236-
return self.parse_response(conn, command_name, **options)
1237-
except BaseException:
1238-
# An exception while reading or writing leaves the connection in
1239-
# an unknown state. There may be un-written or un-read data
1240-
# so we cannot re-use it for a subsequent command/response transaction.
1241-
# This can be any error not handled by the Connection itself, such
1242-
# as BaseExceptions may have been used to interrupt IO, when using
1243-
# gevent.
1244-
conn.disconnect()
1245-
raise
1234+
conn.send_command(*args)
1235+
return self.parse_response(conn, command_name, **options)
12461236

12471237
def _disconnect_raise(self, conn, error):
12481238
"""

0 commit comments

Comments
 (0)