Skip to content

Commit 3fbc2ef

Browse files
committed
Use tomllib over tomli when available
1 parent afe4117 commit 3fbc2ef

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tools/update_requirements.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
import sys
33
from pathlib import Path
44

5-
import tomli
5+
try:
6+
import tomllib
7+
except ImportError:
8+
import tomli as tomllib
69

710
if sys.version_info < (3, 6):
811
print('This script requires Python 3.6 to work correctly')
@@ -15,7 +18,7 @@
1518
doc_reqs = repo_root / 'doc-requirements.txt'
1619

1720
with open(pyproject_toml, 'rb') as fobj:
18-
config = tomli.load(fobj)
21+
config = tomllib.load(fobj)
1922
requirements = config['project']['dependencies']
2023
doc_requirements = config['project']['optional-dependencies']['doc']
2124

0 commit comments

Comments
 (0)