diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index 7d90148aa..6187b8b3a 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -150,7 +150,16 @@ def get_version(self) -> str: stdout=PIPE, text=True, ) - return proc.stdout.strip() + return self._parse_version(proc.stdout) + + @staticmethod + def _parse_version(output: str) -> str: + # pyright --version can print an update message ("there is a new pyright version available"), + # make sure we extract only the actual version + for line in output.splitlines(): + if line.startswith("pyright "): + return line + return output.strip() def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: command = [sys.executable, "-m", "pyright", ".", "--outputjson"]