Return the ``legacy_responses`` setting on the client. Defaults to ``True`` (matching the client constructor) when absent from ``connection_kwargs``.
(r)
| 840 | |
| 841 | |
| 842 | def get_legacy_responses(r): |
| 843 | """Return the ``legacy_responses`` setting on the client. |
| 844 | |
| 845 | Defaults to ``True`` (matching the client constructor) when absent |
| 846 | from ``connection_kwargs``. |
| 847 | """ |
| 848 | if isinstance(r, redis.Redis) or isinstance(r, redis.asyncio.Redis): |
| 849 | return r.connection_pool.connection_kwargs.get("legacy_responses", True) |
| 850 | elif isinstance(r, redis.cluster.AbstractRedisCluster): |
| 851 | return r.nodes_manager.connection_kwargs.get("legacy_responses", True) |
| 852 | return True |
| 853 | |
| 854 | |
| 855 | def expected_response_shape(r): |
no test coverage detected