From c9116ebece9c731979e0b34087b31642e018c70b Mon Sep 17 00:00:00 2001 From: jukejian Date: Mon, 24 Mar 2025 21:41:30 +0800 Subject: [PATCH] support python310 tomli --- ci/check_versions.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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"]