Commit 86dba4d6 authored by Fabio Utzig's avatar Fabio Utzig Committed by Fabio Utzig
Browse files

ci: update toml dependency



Switch from toml to tomllib when supported, Python 3.11+, and fallback to
using tomli instead of toml otherwise.

Signed-off-by: default avatarFabio Utzig <utzig@apache.org>
parent 0a1ef372
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -16,7 +16,10 @@

import argparse
import os.path
import toml
try:
    import tomllib
except ModuleNotFoundError:
    import tomli as tomllib

parser = argparse.ArgumentParser(description='Print features from a Cargo.toml.')
parser.add_argument('infile', help='Input file to parse')
@@ -32,7 +35,7 @@ except Exception:
    print("Error reading \"{}\"".format(args.infile))
    exit(1)

config = toml.loads(cargo_toml)
config = tomllib.loads(cargo_toml)
if 'features' not in config:
    print("Missing \"[features]\" section")
    exit(1)
+1 −1
Original line number Diff line number Diff line
toml
tomli