Skip to content
Snippets Groups Projects
Commit 1ff15b5a authored by Alexandru Fikl's avatar Alexandru Fikl Committed by Andreas Klöckner
Browse files

add toml dependency for tomlsh

parent 0c39daa8
No related branches found
No related tags found
No related merge requests found
...@@ -73,8 +73,11 @@ function tomlsh { ...@@ -73,8 +73,11 @@ function tomlsh {
import argparse import argparse
import sys import sys
import toml
try:
import tomllib
except ImportError:
import toml as tomllib
def resolve_dotted_name(data, dotted_name): def resolve_dotted_name(data, dotted_name):
components = dotted_name.split(".") components = dotted_name.split(".")
...@@ -127,7 +130,8 @@ def main(): ...@@ -127,7 +130,8 @@ def main():
parser.print_usage() parser.print_usage()
sys.exit(1) 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)) sys.exit(args.func(data, args))
...@@ -187,7 +191,7 @@ create_and_set_up_virtualenv() ...@@ -187,7 +191,7 @@ create_and_set_up_virtualenv()
$PY_EXE -m pip install --upgrade pip $PY_EXE -m pip install --upgrade pip
$PY_EXE -m pip install setuptools wheel $PY_EXE -m pip install setuptools wheel toml
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment