Skip to content

Commit

Permalink
Fix toml loading on 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
thatch committed Jan 21, 2024
1 parent 36cec16 commit 48676a1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions checkdeps/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
from typing import Dict, Generator, Sequence

try:
from tomllib import load
from tomllib import loads as toml_loads
except ImportError:
from toml import load
from toml import loads as toml_loads # type: ignore
from packaging.requirements import Requirement
from packaging.utils import canonicalize_name

Expand Down Expand Up @@ -56,7 +56,7 @@ def get_metadata_requirements(target_dir: Path) -> Dict[str, Sequence[Requiremen

pyproject_toml = target_dir / "pyproject.toml"
if pyproject_toml.exists():
doc = load(pyproject_toml)
doc = toml_loads(pyproject_toml.read_text())

project = doc.get("project", {})
deps = project.get("dependencies")
Expand Down

0 comments on commit 48676a1

Please sign in to comment.