fix embedded helper import (tomli)

This commit is contained in:
2023-11-28 12:19:19 +00:00
parent e8dca96b59
commit d3f5587e16

View File

@@ -10,7 +10,14 @@ from __future__ import annotations
from typing import TYPE_CHECKING
from pathlib import Path
import tomli
b_use_tomli=False
try:
import tomli
b_use_tomli=True
except ImportError:
import tomllib
import argparse
import os
import logging
@@ -37,7 +44,10 @@ if __name__ == "__main__":
project_rootdir_path = Path(__file__).parent.parent.absolute()
with open(project_rootdir_path / "pyproject.toml", mode="rb") as fp:
pyproject = tomli.load(fp)
if b_use_tomli:
pyproject = tomli.load(fp)
else:
pyproject = tomllib.load(fp)
parser = argparse.ArgumentParser(
prog="continuous-integration-helper", description="A tiny set of scripts to help continous integration on python"