Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/attributecode/attrib.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,12 @@ def generate_sctk_input(abouts, min_license_score, license_dict):
for key in lic_key:
lic_name.append(license_dict[key][0])
lic_score = about.license_score.value
assert len(lic_key) == len(lic_name)
assert len(lic_key) == len(lic_score)
if len(lic_key) != len(lic_name):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be you can extract a variable?

Suggested change
if len(lic_key) != len(lic_name):
len_lics = len(lic_key)
if len_lics != len(lic_name):

and then use it in the messages and other tests below?

raise ValueError("Mismatch in length: 'lic_key' and 'lic_name' must have the same number of elements")
Comment thread
Dhruv276R marked this conversation as resolved.
Outdated

if len(lic_key) != len(lic_score):
raise ValueError("Mismatch in length: 'lic_key' and 'lic_score' must have the same number of elements")

Comment thread
Dhruv276R marked this conversation as resolved.

lic_key_expression = about.license_key_expression.value
if lic_key_expression:
Expand Down