Skip to content

Commit fd4772b

Browse files
committed
Add an explicit __bool__ to ToolRepository
1 parent 6eafd15 commit fd4772b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cyclonedx/model/tool.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ def __init__(self, *, components: Optional[Iterable[Component]] = None,
169169
def __len__(self) -> int:
170170
return len(self._tools)
171171

172+
def __bool__(self) -> bool:
173+
return any([self._tools, self._components, self._services])
174+
172175
@property
173176
def components(self) -> Iterable[Component]:
174177
"""

0 commit comments

Comments
 (0)