From 1ff15b5a90e5680ad713342ae2a8decd8bb4632e Mon Sep 17 00:00:00 2001 From: Alexandru Fikl <alexfikl@gmail.com> Date: Thu, 27 Jun 2024 20:17:08 +0300 Subject: [PATCH] add toml dependency for tomlsh --- ci-support.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ci-support.sh b/ci-support.sh index 3a13c3e..47ac5a5 100644 --- a/ci-support.sh +++ b/ci-support.sh @@ -73,8 +73,11 @@ function tomlsh { import argparse import sys -import toml +try: + import tomllib +except ImportError: + import toml as tomllib def resolve_dotted_name(data, dotted_name): components = dotted_name.split(".") @@ -127,7 +130,8 @@ def main(): parser.print_usage() sys.exit(1) - data = toml.load(args.filename) + with open(args.filename, encoding="utf-8") as toml: + data = tomllib.load(toml) sys.exit(args.func(data, args)) @@ -187,7 +191,7 @@ create_and_set_up_virtualenv() $PY_EXE -m pip install --upgrade pip - $PY_EXE -m pip install setuptools wheel + $PY_EXE -m pip install setuptools wheel toml } -- GitLab