Skip to content

Commit ce25586

Browse files
author
Riku Häkli
committed
Add missing VulnerabilityAnalysis comparator for sorting
Signed-off-by: Riku Häkli <hakli.riku@gmail.com>
1 parent 00fd744 commit ce25586

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

cyclonedx/model/vulnerability.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,11 @@ def __eq__(self, other: object) -> bool:
349349
return self.__comparable_tuple() == other.__comparable_tuple()
350350
return False
351351

352+
def __lt__(self, other: Any) -> bool:
353+
if isinstance(other, VulnerabilityAnalysis):
354+
return self.__comparable_tuple() < other.__comparable_tuple()
355+
return NotImplemented
356+
352357
def __hash__(self) -> int:
353358
return hash(self.__comparable_tuple())
354359

0 commit comments

Comments
 (0)