Skip to content

Commit

Permalink
Use tomllib.loads instead of loads
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed Aug 18, 2023
1 parent c0f4379 commit 6e78943
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/validate_pyproject/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
)

from . import __version__
from ._tomllib import TOMLDecodeError, loads
from . import _tomllib as tomllib
from .api import Validator
from .errors import ValidationError
from .plugins import PluginWrapper
Expand All @@ -32,7 +32,7 @@
_logger = logging.getLogger(__package__)
T = TypeVar("T", bound=NamedTuple)

_REGULAR_EXCEPTIONS = (ValidationError, TOMLDecodeError)
_REGULAR_EXCEPTIONS = (ValidationError, tomllib.TOMLDecodeError)


@contextmanager
Expand Down Expand Up @@ -220,7 +220,7 @@ def _run_on_file(validator: Validator, params: CliParams, file: io.TextIOBase):
if file in (sys.stdin, _STDIN):
print("Expecting input via `stdin`...", file=sys.stderr, flush=True)

toml_equivalent = loads(file.read())
toml_equivalent = tomllib.loads(file.read())
validator(toml_equivalent)
if params.dump_json:
print(json.dumps(toml_equivalent, indent=2))
Expand Down

0 comments on commit 6e78943

Please sign in to comment.