Skip to content

Commit 9e67998

Browse files
committed
fixed some abstract definitions
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent 79538e9 commit 9e67998

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

cyclonedx/output/schema.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# SPDX-License-Identifier: Apache-2.0
1818
# Copyright (c) OWASP Foundation. All Rights Reserved.
1919

20-
from abc import ABC
20+
from abc import ABC, abstractmethod
2121

2222

2323
class BaseSchemaVersion(ABC):
@@ -37,8 +37,9 @@ def component_supports_bom_ref(self) -> bool:
3737
def component_supports_external_references(self) -> bool:
3838
return True
3939

40+
@abstractmethod
4041
def get_schema_version(self) -> str:
41-
pass
42+
raise NotImplementedError
4243

4344

4445
class SchemaVersion1Dot3(BaseSchemaVersion):

cyclonedx/parser/conda.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# SPDX-License-Identifier: Apache-2.0
1818
# Copyright (c) OWASP Foundation. All Rights Reserved.
1919
import json
20-
from abc import abstractmethod
20+
from abc import ABCMeta, abstractmethod
2121
from typing import List
2222

2323
from . import BaseParser
@@ -26,11 +26,10 @@
2626
from ..utils.conda import parse_conda_json_to_conda_package, parse_conda_list_str_to_conda_package, CondaPackage
2727

2828

29-
class _BaseCondaParser(BaseParser):
29+
class _BaseCondaParser(BaseParser, metaclass=ABCMeta):
30+
"""Internal abstract parser - not for programmatic use.
3031
"""
31-
Internal abstract parser - not for programatic use.
3232

33-
"""
3433
def __init__(self, conda_data: str):
3534
super().__init__()
3635
self._conda_packages: List[CondaPackage] = []

0 commit comments

Comments
 (0)