From bebdbf102e85cb575af291ea368be7cb6a598dbe Mon Sep 17 00:00:00 2001 From: Zach Burnett Date: Thu, 9 Mar 2023 09:49:25 -0500 Subject: [PATCH] import tomli as tomllib --- docs/source/conf.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 463e4973..7efe9096 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,7 +1,10 @@ import importlib import stsci_rtd_theme import sys -import tomli +if sys.version_info < (3, 11): + import tomli as tomllib +else: + import tomllib from datetime import datetime from pathlib import Path @@ -22,7 +25,7 @@ def setup(app): # Read the package's `pyproject.toml` so that we can use relevant # values here: with open(REPO_ROOT / "pyproject.toml", "rb") as configuration_file: - conf = tomli.load(configuration_file) + conf = tomllib.load(configuration_file) setup_metadata = conf['project'] project = setup_metadata["name"]