Skip to content

Commit b2893a8

Browse files
committed
Support TOML v1.0.0 syntax in pyproject.toml
fixes #1180
1 parent 809cccb commit b2893a8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

coverage/tomlconfig.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
# TOML support is an install-time extra option.
1414
try:
15-
import toml
15+
import tomli
1616
except ImportError: # pragma: not covered
17-
toml = None
17+
tomli = None
1818

1919

2020
class TomlDecodeError(Exception):
@@ -44,11 +44,11 @@ def read(self, filenames):
4444
toml_text = fp.read()
4545
except OSError:
4646
return []
47-
if toml:
47+
if tomli is not None:
4848
toml_text = substitute_variables(toml_text, os.environ)
4949
try:
50-
self.data = toml.loads(toml_text)
51-
except toml.TomlDecodeError as err:
50+
self.data = tomli.loads(toml_text)
51+
except tomli.TomlDecodeError as err:
5252
raise TomlDecodeError(*err.args)
5353
return [filename]
5454
else:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def better_set_verbosity(v):
107107

108108
extras_require={
109109
# Enable pyproject.toml support.
110-
'toml': ['toml'],
110+
'toml': ['tomli'],
111111
},
112112

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

0 commit comments

Comments
 (0)