Skip to content

Commit db90443

Browse files
committed
fix: add f obj to tomllib.load()
1 parent ea657c4 commit db90443

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cpp_linter_hooks/util.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ def get_version_from_dependency(tool: str) -> Optional[str]:
1818
pyproject_path = Path(__file__).parent.parent / "pyproject.toml"
1919
if not pyproject_path.exists():
2020
return None
21-
data = tomllib.load(pyproject_path)
21+
with open(pyproject_path, "rb") as f:
22+
data = tomllib.load(f)
2223
dependencies = data.get("project", {}).get("dependencies", [])
2324
for dep in dependencies:
2425
if dep.startswith(f"{tool}=="):

0 commit comments

Comments
 (0)