Skip to content

Commit

Permalink
fix: use tomli for [toml] under more precise conditions. #1390
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Jun 1, 2022
1 parent a8758a6 commit 3a23d8a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ Unreleased
1381`_ and `pull 1388`_). Slightly improved performance when using the C
trace function, as most environments do.

- The conditions for using tomllib from the standard library have been made
more precise, so that 3.11 alphas will continue to work. Closes `issue
1390`_.

.. _pull 1381: https://github.com/nedbat/coveragepy/pull/1381
.. _pull 1388: https://github.com/nedbat/coveragepy/pull/1388
.. _issue 1390: https://github.com/nedbat/coveragepy/issues/1390


.. _changes_64:
Expand Down
2 changes: 1 addition & 1 deletion coverage/tomlconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from coverage.misc import import_third_party, substitute_variables


if env.PYVERSION >= (3, 11):
if env.PYVERSION >= (3, 11, 0, "alpha", 7):
import tomllib # pylint: disable=import-error
else:
# TOML support on Python 3.10 and below is an install-time extra option.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def better_set_verbosity(v):

extras_require={
# Enable pyproject.toml support.
'toml': ['tomli; python_version < "3.11"'],
'toml': ['tomli; python_full_version<="3.11.0a6"'],
},

# We need to get HTML assets from our htmlfiles directory.
Expand Down

0 comments on commit 3a23d8a

Please sign in to comment.