Skip to content

Commit 9f71e27

Browse files
Better docs and simpler ifs
Signed-off-by: Artem Smotrakov <asmotrakov@riotgames.com>
1 parent 3011fb0 commit 9f71e27

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cyclonedx/model/bom.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def timestamp(self, timestamp: datetime) -> None:
8585
@property
8686
def component(self) -> Optional[Component]:
8787
"""
88-
Get a Component of this Bom Metadata.
88+
The (optional) component that the BOM describes.
8989
9090
Returns:
9191
`cyclonedx.model.component.Component` instance for this Bom Metadata.
@@ -95,7 +95,7 @@ def component(self) -> Optional[Component]:
9595
@component.setter
9696
def component(self, component: Component) -> None:
9797
"""
98-
Set a Component for this Bom Metadata.
98+
The (optional) component that the BOM describes.
9999
100100
Args:
101101
component

cyclonedx/output/xml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def _add_metadata_element(self) -> None:
113113
for tool in bom_metadata.tools:
114114
self._add_tool(parent_element=tools_e, tool=tool)
115115

116-
if bom_metadata.component is not None:
116+
if bom_metadata.component:
117117
metadata_e.append(self._add_component_element(component=bom_metadata.component))
118118

119119
def _add_component_element(self, component: Component) -> ElementTree.Element:

0 commit comments

Comments
 (0)