Skip to content

Commit 9c8cb74

Browse files
authored
Convert toml dependency to tomllib (#138)
1 parent 679be53 commit 9c8cb74

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

jinja2cli/cli.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,12 @@ def _parse_qs(data):
188188

189189

190190
def _load_toml():
191-
import toml
191+
if sys.version_info < (3, 11):
192+
import tomli as tomllib
193+
else:
194+
import tomllib
192195

193-
return toml.loads, Exception, MalformedToml
196+
return tomllib.loads, Exception, MalformedToml
194197

195198

196199
def _load_xml():

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
install_requires=install_requires,
3131
extras_require={
3232
"yaml": install_requires + ["pyyaml"],
33-
"toml": install_requires + ["toml"],
33+
"toml": install_requires + ["tomli;python_version<'3.11'"],
3434
"xml": install_requires + ["xmltodict"],
3535
"tests": install_requires + tests_requires,
3636
"hjson": install_requires + ["hjson"],

0 commit comments

Comments
 (0)