diff options
| -rwxr-xr-x | redis/client.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/redis/client.py b/redis/client.py index 94b1baa..24120d2 100755 --- a/redis/client.py +++ b/redis/client.py @@ -775,7 +775,8 @@ class Redis(object): return self.parse_response(connection, command_name, **options) except (ConnectionError, TimeoutError) as e: connection.disconnect() - if not connection.retry_on_timeout and isinstance(e, TimeoutError): + if not (connection.retry_on_timeout and + isinstance(e, TimeoutError)): raise connection.send_command(*args) return self.parse_response(connection, command_name, **options) @@ -3012,7 +3013,8 @@ class PubSub(object): return command(*args) except (ConnectionError, TimeoutError) as e: connection.disconnect() - if not connection.retry_on_timeout and isinstance(e, TimeoutError): + if not (connection.retry_on_timeout and + isinstance(e, TimeoutError)): raise # Connect manually here. If the Redis server is down, this will # fail and raise a ConnectionError as desired. |
