Skip to content

Commit d1afe4d

Browse files
committed
fix(robotlangserver): robot version string is incorrectly parsed if version has no patch
correct can't get namespace diagnostics ''>=' not supported between instances of 'NoneType' and 'int'' sometimes happens closes: #99
1 parent e6bc7a2 commit d1afe4d

File tree

1 file changed

+2
-2
lines changed
  • robotcode/language_server/robotframework/utils

1 file changed

+2
-2
lines changed

robotcode/language_server/robotframework/utils/version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def s_to_i(s: Optional[str]) -> Optional[int]:
5555
return Version(
5656
int(m.group("major")),
5757
int(m.group("minor")),
58-
s_to_i(m.group("patch")),
58+
s_to_i(m.group("patch")) or 0,
5959
m.group("pre_id"),
6060
s_to_i(m.group("pre_number")),
6161
s_to_i(m.group("dev")),
@@ -69,4 +69,4 @@ def s_to_i(s: Optional[str]) -> Optional[int]:
6969

7070

7171
if __name__ == "__main__":
72-
print(get_robot_version() >= (4, 0))
72+
print(get_robot_version())

0 commit comments

Comments
 (0)