fix embedded helper import (tomli)
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user