Skip to content

Commit 85ee269

Browse files
committed
fix pyright version parsing
1 parent 5d4cbb9 commit 85ee269

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

conformance/src/type_checker.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,16 @@ def get_version(self) -> str:
150150
stdout=PIPE,
151151
text=True,
152152
)
153-
return proc.stdout.strip()
153+
return self._parse_version(proc.stdout)
154+
155+
@staticmethod
156+
def _parse_version(output: str) -> str:
157+
# pyright --version can print an update message ("there is a new pyright version available"),
158+
# make sure we extract only the actual version
159+
for line in output.splitlines():
160+
if line.startswith("pyright "):
161+
return line
162+
return output.strip()
154163

155164
def run_tests(self, test_files: Sequence[str]) -> dict[str, str]:
156165
command = [sys.executable, "-m", "pyright", ".", "--outputjson"]

0 commit comments

Comments
 (0)