Skip to content

Commit b841009

Browse files
committed
intercomp
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent c3e59a8 commit b841009

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

tests/__init__.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@
2222
from unittest import TestCase
2323
from uuid import UUID
2424

25-
if sys.version_info >= (3, 11):
26-
from tomllib import load as toml_load
27-
else:
28-
from toml import load as toml_load
29-
3025
from sortedcontainers import SortedSet
3126

3227
from cyclonedx.output import BomRefDiscriminator as _BomRefDiscriminator
@@ -199,5 +194,11 @@ def __name__(self) -> str:
199194

200195

201196
def load_pyproject() -> Dict[str, Any]:
202-
with open(path.join(path.dirname(__file__), '..', 'pyproject.toml'), 'rb') as f:
203-
return toml_load(f)
197+
if sys.version_info >= (3, 11):
198+
from tomllib import load as toml_load
199+
with open(path.join(path.dirname(__file__), '..', 'pyproject.toml'), 'rb') as f:
200+
return toml_load(f)
201+
else:
202+
from toml import load as toml_load
203+
with open(path.join(path.dirname(__file__), '..', 'pyproject.toml'), 'rt') as f:
204+
return toml_load(f)

0 commit comments

Comments
 (0)