From 0b6d14d464d06d8329fdc797c0286de25dca935d Mon Sep 17 00:00:00 2001 From: Jan Kowalleck Date: Sun, 21 Jul 2024 20:02:16 +0200 Subject: [PATCH] style: default values Signed-off-by: Jan Kowalleck --- cyclonedx/model/bom.py | 7 +++---- cyclonedx/model/vulnerability.py | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/cyclonedx/model/bom.py b/cyclonedx/model/bom.py index edad995e..e51b2e07 100644 --- a/cyclonedx/model/bom.py +++ b/cyclonedx/model/bom.py @@ -133,10 +133,9 @@ def tools(self) -> ToolsRepository: @tools.setter def tools(self, tools: Union[Iterable[Tool], ToolsRepository]) -> None: - if isinstance(tools, ToolsRepository): - self._tools = tools - else: - self._tools = ToolsRepository(tools=tools) + self._tools = tools \ + if isinstance(tools, ToolsRepository) \ + else ToolsRepository(tools=tools) @property @serializable.xml_array(serializable.XmlArraySerializationType.NESTED, 'author') diff --git a/cyclonedx/model/vulnerability.py b/cyclonedx/model/vulnerability.py index c9dfa629..76acb72c 100644 --- a/cyclonedx/model/vulnerability.py +++ b/cyclonedx/model/vulnerability.py @@ -1260,10 +1260,9 @@ def tools(self) -> ToolsRepository: @tools.setter def tools(self, tools: Union[Iterable[Tool], ToolsRepository]) -> None: - if isinstance(tools, ToolsRepository): - self._tools = tools - else: - self._tools = ToolsRepository(tools=tools) + self._tools = tools \ + if isinstance(tools, ToolsRepository) \ + else ToolsRepository(tools=tools) @property @serializable.xml_sequence(18)