Skip to content

Commit c57e408

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

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
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:

0 commit comments

Comments
 (0)