MCPcopy
hub / github.com/redis/redis-py / get_legacy_responses

Function get_legacy_responses

redis/commands/helpers.py:135–147  ·  view source on GitHub ↗

Return the user-supplied ``legacy_responses`` flag for ``client``. Defaults to ``True`` when the flag is not present in the client's ``connection_kwargs``. Mirrors :func:`get_protocol_version` so module command bases can read both the protocol and the response-shape selection from t

(client)

Source from the content-addressed store, hash-verified

133
134
135def get_legacy_responses(client):
136 """Return the user-supplied ``legacy_responses`` flag for ``client``.
137
138 Defaults to ``True`` when the flag is not present in the client's
139 ``connection_kwargs``. Mirrors :func:`get_protocol_version` so module
140 command bases can read both the protocol and the response-shape
141 selection from the same place.
142 """
143 if isinstance(client, redis.Redis) or isinstance(client, redis.asyncio.Redis):
144 return client.connection_pool.connection_kwargs.get("legacy_responses", True)
145 elif isinstance(client, redis.cluster.AbstractRedisCluster):
146 return client.nodes_manager.connection_kwargs.get("legacy_responses", True)
147 return True
148
149
150def apply_module_callbacks(

Callers 10

__init__Method · 0.50
__init__Method · 0.50
__init__Method · 0.50
__init__Method · 0.50
__init__Method · 0.50
_parse_resultsMethod · 0.50
__init__Method · 0.50
__init__Method · 0.50
__init__Method · 0.50

Calls 1

getMethod · 0.45

Tested by

no test coverage detected