Skip to content

Commit e88918a

Browse files
authored
Update packageinfo.py
tool might no be present with certain managers (e.g. uv). acessing tool with a empty dict fallback allows this to work
1 parent 7347d19 commit e88918a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

licensecheck/packageinfo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def getMyPackageMetadata() -> dict[str, Any]:
162162

163163
if Path("pyproject.toml").exists():
164164
pyproject = tomli.loads(Path("pyproject.toml").read_text(encoding="utf-8"))
165-
tool = pyproject["tool"]
165+
tool = pyproject.get("tool",{})
166166
if "poetry" in tool:
167167
return tool["poetry"]
168168
if "flit" in tool:

0 commit comments

Comments
 (0)