Skip to content

Commit

Permalink
rework to version detct
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Kowalleck <[email protected]>
  • Loading branch information
jkowalleck committed Dec 13, 2022
1 parent 18e34b8 commit 4aea31f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cyclonedx_py/parser/poetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(

poetry_lock_metadata = poetry_lock['metadata']
try:
poetry_lock_version = str(poetry_lock_metadata['lock-version']).split('.')
poetry_lock_version = tuple(int(p) for p in str(poetry_lock_metadata['lock-version']).split('.'))
except Exception:
poetry_lock_version = (0,)
debug_message('detected poetry_lock_version: {!r}', poetry_lock_version)
Expand All @@ -60,7 +60,7 @@ def __init__(
)
debug_message('detecting package_files')
if poetry_lock_version >= (2,):
package_files = package['fies']
package_files = package['files']
else:
package_files = poetry_lock_metadata['files'][package['name']]
debug_message('processing package_files: {!r}', package_files)
Expand Down

0 comments on commit 4aea31f

Please sign in to comment.