diff --git a/redis/asyncio/connection.py b/redis/asyncio/connection.py index b51e4fd8ce..2e24f253c2 100644 --- a/redis/asyncio/connection.py +++ b/redis/asyncio/connection.py @@ -514,7 +514,7 @@ async def read_response( try: if ( read_timeout is not None - and self.protocol == "3" + and self.protocol in ["3", 3] and not HIREDIS_AVAILABLE ): async with async_timeout(read_timeout): @@ -526,7 +526,7 @@ async def read_response( response = await self._parser.read_response( disable_decoding=disable_decoding ) - elif self.protocol == "3" and not HIREDIS_AVAILABLE: + elif self.protocol in ["3", 3] and not HIREDIS_AVAILABLE: response = await self._parser.read_response( disable_decoding=disable_decoding, push_request=push_request ) diff --git a/redis/connection.py b/redis/connection.py index ee3bece11c..b2e6eaac83 100644 --- a/redis/connection.py +++ b/redis/connection.py @@ -433,7 +433,7 @@ def read_response(self, disable_decoding=False, push_request=False): host_error = self._host_error() try: - if self.protocol == "3" and not HIREDIS_AVAILABLE: + if self.protocol in ["3", 3] and not HIREDIS_AVAILABLE: response = self._parser.read_response( disable_decoding=disable_decoding, push_request=push_request )