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

Function check_protocol_version

redis/utils.py:286–296  ·  view source on GitHub ↗
(
    protocol: Optional[Union[str, int]], expected_version: int = 3
)

Source from the content-addressed store, hash-verified

284
285
286def check_protocol_version(
287 protocol: Optional[Union[str, int]], expected_version: int = 3
288) -> bool:
289 if protocol is None:
290 protocol = DEFAULT_RESP_VERSION
291 if isinstance(protocol, str):
292 try:
293 protocol = int(protocol)
294 except ValueError:
295 return False
296 return protocol == expected_version
297
298
299def get_lib_version():

Callers 15

test_resp3_matchesMethod · 0.90
test_resp2_matchesMethod · 0.90
__init__Method · 0.90
listenMethod · 0.90
__init__Method · 0.90
__init__Method · 0.90
_parse_resultsMethod · 0.90
searchMethod · 0.90
searchMethod · 0.90
vsimMethod · 0.90

Calls

no outgoing calls

Tested by 4

test_resp3_matchesMethod · 0.72
test_resp2_matchesMethod · 0.72