Skip to content

Commit 118b666

Browse files
committed
tomli is integrated as tomllib since Python 3.11
1 parent fbfc559 commit 118b666

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

docs/source/conf.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,12 @@
5454
# built documents.
5555
#
5656
# The short X.Y version.
57-
import tomli
57+
try:
58+
import tomllib
59+
except ImportError:
60+
import tomli
5861
with open("../../pyproject.toml", "rb") as f:
59-
toml_dict = tomli.load(f)
62+
toml_dict = tomllib.load(f)
6063
version = toml_dict['project']['version']
6164
# The full version, including alpha/beta/rc tags.
6265
release = version

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ wheel
44
Cython
55
Sphinx
66
flake8
7-
tomli
7+
tomli;python_version<"3.11"
88
pytest>=8.0.0

0 commit comments

Comments
 (0)