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: Fabio Utzig <utzig@apache.org>
This commit is contained in:
parent
0a1ef37263
commit
86dba4d6c1
|
@ -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 @@
|
|||
toml
|
||||
tomli
|
||||
|
|
Loading…
Reference in New Issue