Skip to content

Commit c7a3687

Browse files
committed
docs: docs can be built on python 3.10
1 parent b060ca4 commit c7a3687

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

docs/source/conf.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,17 @@
1919
#
2020
import os
2121
import sys
22-
import tomllib
22+
if sys.version_info < (3, 11):
23+
from tomli import load as load_toml
24+
else:
25+
from tomllib import load as load_toml
26+
2327

2428
sys.path.insert(0, os.path.abspath('../..'))
2529
def get_project_metadata():
2630
path = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../pyproject.toml"))
2731
with open(path, "rb") as f:
28-
return tomllib.load(f)['project']
32+
return load_toml(f)['project']
2933

3034
metadata = get_project_metadata()
3135

0 commit comments

Comments
 (0)