The format of the version string isn't always consistent. Sometimes it's just the version number e.g. '9.6.18', and sometimes it contains specific build information e.g. '12.4 (Ubuntu 12.4-0ubuntu0.20.04.1)'. Just extract the major and minor version numbers.
(version_string: str)
| 385 | |
| 386 | @staticmethod |
| 387 | def _parse_raw_version_string(version_string: str) -> float: |
| 388 | """ |
| 389 | The format of the version string isn't always consistent. Sometimes |
| 390 | it's just the version number e.g. '9.6.18', and sometimes |
| 391 | it contains specific build information e.g. |
| 392 | '12.4 (Ubuntu 12.4-0ubuntu0.20.04.1)'. Just extract the major and |
| 393 | minor version numbers. |
| 394 | """ |
| 395 | version_segment = version_string.split(" ")[0] |
| 396 | major, minor = version_segment.split(".")[:2] |
| 397 | return float(f"{major}.{minor}") |
| 398 | |
| 399 | async def get_version(self) -> float: |
| 400 | """ |
no outgoing calls