Skip to content

Commit 5d35e81

Browse files
committed
Remove unneeded code
Also a small formatting change
1 parent ee24f0d commit 5d35e81

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

cyclonedx/model/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
SchemaVersion1Dot6,
5252
)
5353

54+
5455
@serializable.serializable_enum
5556
class DataFlow(str, Enum):
5657
"""
@@ -1197,6 +1198,7 @@ def __repr__(self) -> str:
11971198

11981199
# Importing here to avoid a circular import
11991200
from .tool import Tool # pylint: disable=wrong-import-position
1201+
12001202
ThisTool = Tool(
12011203
vendor='CycloneDX',
12021204
name='cyclonedx-python-lib',
@@ -1234,4 +1236,5 @@ def __repr__(self) -> str:
12341236
type=ExternalReferenceType.WEBSITE,
12351237
url=XsUri('https://github.com/CycloneDX/cyclonedx-python-lib/#readme')
12361238
)
1237-
])
1239+
]
1240+
)

cyclonedx/model/bom.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -137,17 +137,6 @@ def tools(self, tools: Union[Iterable[Tool], ToolsRepository]) -> None:
137137
if isinstance(tools, ToolsRepository):
138138
self._tools = tools
139139
else:
140-
# This allows the old behavior of assigning the list of tools directly to bom.metadata.tools
141-
warn(
142-
'`bom.metadata.tools` as a list of Tool objects is deprecated from CycloneDX v1.5 '
143-
'onwards. Please use lists of `Component` and `Service` objects as `tools.components` '
144-
'and `tools.services`, respectively.'
145-
)
146-
if hasattr(self, '_tools') and (self._tools._components or self._tools._services): # pylint: disable=protected-access
147-
raise MutuallyExclusivePropertiesException(
148-
'Cannot serialize both old (CycloneDX <= 1.4) and new '
149-
'(CycloneDX >= 1.5) format for tools.'
150-
)
151140
self._tools = ToolsRepository(tools=tools)
152141

153142
@property

0 commit comments

Comments
 (0)