Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 committed Jun 5, 2023
1 parent b6f4516 commit 2445868
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/npe2/_setuptools_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def _lazy_tomli_load(data: str) -> dict[str, Any]:
try:
import tomllib
except ImportError:
import tomli as tomllib
import tomli as tomllib # type: ignore [no-redef]

return tomllib.loads(data)

Expand Down
4 changes: 2 additions & 2 deletions src/npe2/manifest/_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ def from_file(cls, path: Union[Path, str]):
try:
import tomllib
except ImportError:
import tomli as tomllib
import tomli as tomllib # type: ignore [no-redef]

loader = tomllib.load
elif path.suffix.lower() in (".yaml", ".yml"):
loader = yaml.safe_load
else:
raise ValueError(f"unrecognized file extension: {path}") # pragma: no cover

with open(path, mode='rb') as f:
with open(path, mode="rb") as f:
data = loader(f) or {}

if path.name == "pyproject.toml":
Expand Down

0 comments on commit 2445868

Please sign in to comment.