(
protocol: Optional[Union[str, int]], expected_version: int = 3
)
| 284 | |
| 285 | |
| 286 | def 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 | |
| 299 | def get_lib_version(): |
no outgoing calls