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 2222from unittest import TestCase
2323from 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-
3025from sortedcontainers import SortedSet
3126
3227from cyclonedx .output import BomRefDiscriminator as _BomRefDiscriminator
@@ -199,5 +194,11 @@ def __name__(self) -> str:
199194
200195
201196def 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