Skip to content

Commit 03bb162

Browse files
authored
Merge pull request #92 from fosslight/copyright
Fix the bug that can't extract copyright
2 parents d613936 + 50d4c0f commit 03bb162

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/fosslight_source/_parsing_scancode_file_item.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,14 @@ def parsing_file_item(scancode_file_list, has_error, need_matched_license=False)
7878
continue
7979
copyright_value_list = []
8080
for x in copyright_list:
81-
copyright_value_list.append(x.get("value", ""))
81+
latest_key_data = x.get("copyright", "")
82+
if latest_key_data:
83+
copyright_data = latest_key_data
84+
else:
85+
copyright_data = x.get("value", "")
86+
if copyright_data:
87+
copyright_value_list.append(copyright_data)
88+
8289
result_item.copyright = copyright_value_list
8390

8491
# Set the license value

0 commit comments

Comments
 (0)