File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 22
22
from unittest import TestCase
23
23
from uuid import UUID
24
24
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
-
30
25
from sortedcontainers import SortedSet
31
26
32
27
from cyclonedx .output import BomRefDiscriminator as _BomRefDiscriminator
@@ -199,5 +194,11 @@ def __name__(self) -> str:
199
194
200
195
201
196
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 )
You can’t perform that action at this time.
0 commit comments