improve version format check

This commit is contained in:
mattie ruth backman
2026-03-31 12:24:11 -04:00
committed by Mattie Ruth
parent 565b9b961d
commit 3e255f3d21
2 changed files with 16 additions and 10 deletions

View File

@@ -304,7 +304,10 @@ class RTVIProcessor(FrameProcessor):
version_error = None
if version:
try:
self._client_version = [int(v) for v in version.split(".")]
parts = [int(v) for v in version.split(".")]
if len(parts) != 3:
raise ValueError
self._client_version = parts
protocol_major = int(RTVI.PROTOCOL_VERSION.split(".")[0])
if self._client_version[0] != protocol_major:
version_error = f"RTVI version {version} is not compatible with server protocol {RTVI.PROTOCOL_VERSION}."