diff --git a/ci/check_versions.py b/ci/check_versions.py index d42062a2553..fe6023153f2 100644 --- a/ci/check_versions.py +++ b/ci/check_versions.py @@ -11,7 +11,12 @@ def get_versions(): """ Gets the current version in both python/Cargo.toml and Cargo.toml files. """ - import tomllib + try: + # Python 3.11+ + import tomllib + except ImportError: + # Python 3.6-3.10 use tomli + import tomli as tomllib with open("python/Cargo.toml", "rb") as file: pylance_version = tomllib.load(file)["package"]["version"]