Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion conformance/src/type_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down